Nothing looks awful, so we can just turn it on.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
( )
yuja |
hg-reviewers |
Nothing looks awful, so we can just turn it on.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | contrib/clang-format-blacklist (1 line) | |||
M | contrib/hgsh/hgsh.c (20 lines) |
# Files that just need to be migrated to the formatter. | # Files that just need to be migrated to the formatter. | ||||
# Do not add new files here! | # Do not add new files here! | ||||
contrib/hgsh/hgsh.c | |||||
mercurial/cext/base85.c | mercurial/cext/base85.c | ||||
mercurial/cext/bdiff.c | mercurial/cext/bdiff.c | ||||
mercurial/cext/charencode.c | mercurial/cext/charencode.c | ||||
mercurial/cext/charencode.h | mercurial/cext/charencode.h | ||||
mercurial/cext/diffhelpers.c | mercurial/cext/diffhelpers.c | ||||
mercurial/cext/dirs.c | mercurial/cext/dirs.c | ||||
mercurial/cext/manifest.c | mercurial/cext/manifest.c | ||||
mercurial/cext/mpatch.c | mercurial/cext/mpatch.c |
*/ | */ | ||||
/* | /* | ||||
* HG_GATEWAY: hostname of gateway/firewall machine that people outside your | * HG_GATEWAY: hostname of gateway/firewall machine that people outside your | ||||
* intranet ssh into if they need to ssh to other machines. if you do not | * intranet ssh into if they need to ssh to other machines. if you do not | ||||
* have such machine, set to NULL. | * have such machine, set to NULL. | ||||
*/ | */ | ||||
#ifndef HG_GATEWAY | #ifndef HG_GATEWAY | ||||
#define HG_GATEWAY "gateway" | #define HG_GATEWAY "gateway" | ||||
#endif | #endif | ||||
/* | /* | ||||
* HG_HOST: hostname of mercurial server. if any machine is allowed, set to | * HG_HOST: hostname of mercurial server. if any machine is allowed, set to | ||||
* NULL. | * NULL. | ||||
*/ | */ | ||||
#ifndef HG_HOST | #ifndef HG_HOST | ||||
#define HG_HOST "mercurial" | #define HG_HOST "mercurial" | ||||
#endif | #endif | ||||
/* | /* | ||||
* HG_USER: username to log in from HG_GATEWAY to HG_HOST. if gateway and | * HG_USER: username to log in from HG_GATEWAY to HG_HOST. if gateway and | ||||
* host username are same, set to NULL. | * host username are same, set to NULL. | ||||
*/ | */ | ||||
#ifndef HG_USER | #ifndef HG_USER | ||||
#define HG_USER "hg" | #define HG_USER "hg" | ||||
#endif | #endif | ||||
/* | /* | ||||
* HG_ROOT: root of tree full of mercurial repos. if you do not want to | * HG_ROOT: root of tree full of mercurial repos. if you do not want to | ||||
* validate location of repo when someone is try to access, set to NULL. | * validate location of repo when someone is try to access, set to NULL. | ||||
*/ | */ | ||||
#ifndef HG_ROOT | #ifndef HG_ROOT | ||||
#define HG_ROOT "/home/hg/repos" | #define HG_ROOT "/home/hg/repos" | ||||
#endif | #endif | ||||
/* | /* | ||||
* HG: path to the mercurial executable to run. | * HG: path to the mercurial executable to run. | ||||
*/ | */ | ||||
#ifndef HG | #ifndef HG | ||||
#define HG "/home/hg/bin/hg" | #define HG "/home/hg/bin/hg" | ||||
#endif | #endif | ||||
/* | /* | ||||
* HG_SHELL: shell to use for actions like "sudo" and "su" access to | * HG_SHELL: shell to use for actions like "sudo" and "su" access to | ||||
* mercurial user, and cron jobs. if you want to make these things | * mercurial user, and cron jobs. if you want to make these things | ||||
* impossible, set to NULL. | * impossible, set to NULL. | ||||
*/ | */ | ||||
#ifndef HG_SHELL | #ifndef HG_SHELL | ||||
#define HG_SHELL NULL | #define HG_SHELL NULL | ||||
/* #define HG_SHELL "/bin/bash" */ | /* #define HG_SHELL "/bin/bash" */ | ||||
#endif | #endif | ||||
/* | /* | ||||
* HG_HELP: some way for users to get support if they have problem. if they | * HG_HELP: some way for users to get support if they have problem. if they | ||||
* should not get helpful message, set to NULL. | * should not get helpful message, set to NULL. | ||||
*/ | */ | ||||
#ifndef HG_HELP | #ifndef HG_HELP | ||||
#define HG_HELP "please contact support@example.com for help." | #define HG_HELP "please contact support@example.com for help." | ||||
#endif | #endif | ||||
/* | /* | ||||
* SSH: path to ssh executable to run, if forwarding from HG_GATEWAY to | * SSH: path to ssh executable to run, if forwarding from HG_GATEWAY to | ||||
* HG_HOST. if you want to use rsh instead (why?), you need to modify | * HG_HOST. if you want to use rsh instead (why?), you need to modify | ||||
* arguments it is called with. see forward_through_gateway. | * arguments it is called with. see forward_through_gateway. | ||||
*/ | */ | ||||
#ifndef SSH | #ifndef SSH | ||||
#define SSH "/usr/bin/ssh" | #define SSH "/usr/bin/ssh" | ||||
#endif | #endif | ||||
/* | /* | ||||
* tell whether to print command that is to be executed. useful for | * tell whether to print command that is to be executed. useful for | ||||
* debugging. should not interfere with mercurial operation, since | * debugging. should not interfere with mercurial operation, since | ||||
* mercurial only cares about stdin and stdout, and this prints to stderr. | * mercurial only cares about stdin and stdout, and this prints to stderr. | ||||
*/ | */ | ||||
static const int debug = 0; | static const int debug = 0; | ||||
exit(EX_OSFILE); | exit(EX_OSFILE); | ||||
} | } | ||||
enum cmdline { | enum cmdline { | ||||
hg_init, | hg_init, | ||||
hg_serve, | hg_serve, | ||||
}; | }; | ||||
/* | /* | ||||
* attempt to verify that a directory is really a hg repo, by testing | * attempt to verify that a directory is really a hg repo, by testing | ||||
* for the existence of a subdirectory. | * for the existence of a subdirectory. | ||||
*/ | */ | ||||
static int validate_repo(const char *repo_root, const char *subdir) | static int validate_repo(const char *repo_root, const char *subdir) | ||||
{ | { | ||||
char *abs_path; | char *abs_path; | ||||
struct stat st; | struct stat st; | ||||
} | } | ||||
if (strcmp(argv[1], "-c") != 0) { | if (strcmp(argv[1], "-c") != 0) { | ||||
goto badargs; | goto badargs; | ||||
} | } | ||||
if (sscanf(argv[2], "hg init %as", &repo) == 1) { | if (sscanf(argv[2], "hg init %as", &repo) == 1) { | ||||
cmd = hg_init; | cmd = hg_init; | ||||
} | } else if (sscanf(argv[2], "hg -R %as serve --stdio", &repo) == 1) { | ||||
else if (sscanf(argv[2], "hg -R %as serve --stdio", &repo) == 1) { | |||||
cmd = hg_serve; | cmd = hg_serve; | ||||
} else { | } else { | ||||
goto badargs; | goto badargs; | ||||
} | } | ||||
repolen = repo ? strlen(repo) : 0; | repolen = repo ? strlen(repo) : 0; | ||||
if (repolen == 0) { | if (repolen == 0) { |