annotate defaults/hg-wrapper.cpp @ 11:389f8678f1d8
add comments to hg-wrapper.cpp.
author |
Robert McIntyre <rlm@mit.edu> |
date |
Wed, 09 Jan 2013 05:11:10 +0000 |
parents |
bd465da5cd0f |
children |
e056798af879 |
rev |
line source |
rlm@9
|
1 #include <cstdlib>
|
rlm@9
|
2 #include <vector>
|
rlm@9
|
3 #include <string>
|
rlm@9
|
4 #include <unistd.h>
|
rlm@9
|
5 #include <boost/algorithm/string/join.hpp>
|
rlm@9
|
6
|
rlm@11
|
7 /** This a simple wrapper script to call
|
rlm@11
|
8 mercurial as a semi-privleged user. */
|
rlm@11
|
9
|
rlm@9
|
10 main( int argc, char ** argv){
|
rlm@9
|
11 std::vector<std::string> input(argv, argv+argc);
|
rlm@9
|
12 input[0] = std::string("hg");
|
rlm@9
|
13 std::string command = boost::algorithm::join(input, " ");
|
rlm@11
|
14 setreuid(geteuid(), geteuid());
|
rlm@9
|
15 return system(command.c_str());
|
rlm@9
|
16 }
|