Mercurial > hg-stable
comparison contrib/hgsh/hgsh.c @ 35999:580f7b1b88c7
hgsh: enable clang-format
Nothing looks awful, so we can just turn it on.
Differential Revision: https://phab.mercurial-scm.org/D2059
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 06 Feb 2018 05:25:36 -0500 |
parents | a4e0908ce35b |
children |
comparison
equal
deleted
inserted
replaced
35998:9724f54923ec | 35999:580f7b1b88c7 |
---|---|
46 * HG_GATEWAY: hostname of gateway/firewall machine that people outside your | 46 * HG_GATEWAY: hostname of gateway/firewall machine that people outside your |
47 * intranet ssh into if they need to ssh to other machines. if you do not | 47 * intranet ssh into if they need to ssh to other machines. if you do not |
48 * have such machine, set to NULL. | 48 * have such machine, set to NULL. |
49 */ | 49 */ |
50 #ifndef HG_GATEWAY | 50 #ifndef HG_GATEWAY |
51 #define HG_GATEWAY "gateway" | 51 #define HG_GATEWAY "gateway" |
52 #endif | 52 #endif |
53 | 53 |
54 /* | 54 /* |
55 * HG_HOST: hostname of mercurial server. if any machine is allowed, set to | 55 * HG_HOST: hostname of mercurial server. if any machine is allowed, set to |
56 * NULL. | 56 * NULL. |
57 */ | 57 */ |
58 #ifndef HG_HOST | 58 #ifndef HG_HOST |
59 #define HG_HOST "mercurial" | 59 #define HG_HOST "mercurial" |
60 #endif | 60 #endif |
61 | 61 |
62 /* | 62 /* |
63 * HG_USER: username to log in from HG_GATEWAY to HG_HOST. if gateway and | 63 * HG_USER: username to log in from HG_GATEWAY to HG_HOST. if gateway and |
64 * host username are same, set to NULL. | 64 * host username are same, set to NULL. |
65 */ | 65 */ |
66 #ifndef HG_USER | 66 #ifndef HG_USER |
67 #define HG_USER "hg" | 67 #define HG_USER "hg" |
68 #endif | 68 #endif |
69 | 69 |
70 /* | 70 /* |
71 * HG_ROOT: root of tree full of mercurial repos. if you do not want to | 71 * HG_ROOT: root of tree full of mercurial repos. if you do not want to |
72 * validate location of repo when someone is try to access, set to NULL. | 72 * validate location of repo when someone is try to access, set to NULL. |
73 */ | 73 */ |
74 #ifndef HG_ROOT | 74 #ifndef HG_ROOT |
75 #define HG_ROOT "/home/hg/repos" | 75 #define HG_ROOT "/home/hg/repos" |
76 #endif | 76 #endif |
77 | 77 |
78 /* | 78 /* |
79 * HG: path to the mercurial executable to run. | 79 * HG: path to the mercurial executable to run. |
80 */ | 80 */ |
81 #ifndef HG | 81 #ifndef HG |
82 #define HG "/home/hg/bin/hg" | 82 #define HG "/home/hg/bin/hg" |
83 #endif | 83 #endif |
84 | 84 |
85 /* | 85 /* |
86 * HG_SHELL: shell to use for actions like "sudo" and "su" access to | 86 * HG_SHELL: shell to use for actions like "sudo" and "su" access to |
87 * mercurial user, and cron jobs. if you want to make these things | 87 * mercurial user, and cron jobs. if you want to make these things |
88 * impossible, set to NULL. | 88 * impossible, set to NULL. |
89 */ | 89 */ |
90 #ifndef HG_SHELL | 90 #ifndef HG_SHELL |
91 #define HG_SHELL NULL | 91 #define HG_SHELL NULL |
92 /* #define HG_SHELL "/bin/bash" */ | 92 /* #define HG_SHELL "/bin/bash" */ |
93 #endif | 93 #endif |
94 | 94 |
95 /* | 95 /* |
96 * HG_HELP: some way for users to get support if they have problem. if they | 96 * HG_HELP: some way for users to get support if they have problem. if they |
97 * should not get helpful message, set to NULL. | 97 * should not get helpful message, set to NULL. |
98 */ | 98 */ |
99 #ifndef HG_HELP | 99 #ifndef HG_HELP |
100 #define HG_HELP "please contact support@example.com for help." | 100 #define HG_HELP "please contact support@example.com for help." |
101 #endif | 101 #endif |
102 | 102 |
103 /* | 103 /* |
104 * SSH: path to ssh executable to run, if forwarding from HG_GATEWAY to | 104 * SSH: path to ssh executable to run, if forwarding from HG_GATEWAY to |
105 * HG_HOST. if you want to use rsh instead (why?), you need to modify | 105 * HG_HOST. if you want to use rsh instead (why?), you need to modify |
106 * arguments it is called with. see forward_through_gateway. | 106 * arguments it is called with. see forward_through_gateway. |
107 */ | 107 */ |
108 #ifndef SSH | 108 #ifndef SSH |
109 #define SSH "/usr/bin/ssh" | 109 #define SSH "/usr/bin/ssh" |
110 #endif | 110 #endif |
111 | 111 |
112 /* | 112 /* |
113 * tell whether to print command that is to be executed. useful for | 113 * tell whether to print command that is to be executed. useful for |
114 * debugging. should not interfere with mercurial operation, since | 114 * debugging. should not interfere with mercurial operation, since |
246 | 246 |
247 enum cmdline { | 247 enum cmdline { |
248 hg_init, | 248 hg_init, |
249 hg_serve, | 249 hg_serve, |
250 }; | 250 }; |
251 | |
252 | 251 |
253 /* | 252 /* |
254 * attempt to verify that a directory is really a hg repo, by testing | 253 * attempt to verify that a directory is really a hg repo, by testing |
255 * for the existence of a subdirectory. | 254 * for the existence of a subdirectory. |
256 */ | 255 */ |
308 goto badargs; | 307 goto badargs; |
309 } | 308 } |
310 | 309 |
311 if (sscanf(argv[2], "hg init %as", &repo) == 1) { | 310 if (sscanf(argv[2], "hg init %as", &repo) == 1) { |
312 cmd = hg_init; | 311 cmd = hg_init; |
313 } | 312 } else if (sscanf(argv[2], "hg -R %as serve --stdio", &repo) == 1) { |
314 else if (sscanf(argv[2], "hg -R %as serve --stdio", &repo) == 1) { | |
315 cmd = hg_serve; | 313 cmd = hg_serve; |
316 } else { | 314 } else { |
317 goto badargs; | 315 goto badargs; |
318 } | 316 } |
319 | 317 |