##// END OF EJS Templates
chg: detect chg started by chg...
Jun Wu -
r28261:2ab59ac0 default
parent child Browse files
Show More
@@ -227,6 +227,8 b' static void execcmdserver(const struct c'
227 memcpy(argv + baseargvsize, opts->args, sizeof(char *) * opts->argsize);
227 memcpy(argv + baseargvsize, opts->args, sizeof(char *) * opts->argsize);
228 argv[argsize - 1] = NULL;
228 argv[argsize - 1] = NULL;
229
229
230 if (putenv("CHGINTERNALMARK=") != 0)
231 abortmsg("failed to putenv (errno = %d)", errno);
230 if (execvp(hgcmd, (char **)argv) < 0)
232 if (execvp(hgcmd, (char **)argv) < 0)
231 abortmsg("failed to exec cmdserver (errno = %d)", errno);
233 abortmsg("failed to exec cmdserver (errno = %d)", errno);
232 free(argv);
234 free(argv);
@@ -490,6 +492,12 b' int main(int argc, const char *argv[], c'
490 if (getenv("CHGDEBUG"))
492 if (getenv("CHGDEBUG"))
491 enabledebugmsg();
493 enabledebugmsg();
492
494
495 if (getenv("CHGINTERNALMARK"))
496 abortmsg("chg started by chg detected.\n"
497 "Please make sure ${HG:-hg} is not a symlink or "
498 "wrapper to chg. Alternatively, set $CHGHG to the "
499 "path of real hg.");
500
493 if (isunsupported(argc - 1, argv + 1))
501 if (isunsupported(argc - 1, argv + 1))
494 execoriginalhg(argv);
502 execoriginalhg(argv);
495
503
@@ -472,3 +472,8 b' class chgunixservice(commandserver.unixs'
472
472
473 def uisetup(ui):
473 def uisetup(ui):
474 commandserver._servicemap['chgunix'] = chgunixservice
474 commandserver._servicemap['chgunix'] = chgunixservice
475
476 # CHGINTERNALMARK is temporarily set by chg client to detect if chg will
477 # start another chg. drop it to avoid possible side effects.
478 if 'CHGINTERNALMARK' in os.environ:
479 del os.environ['CHGINTERNALMARK']
General Comments 0
You need to be logged in to leave comments. Login now