##// END OF EJS Templates
Find right hg command for detached process...
Patrick Mezard -
r10239:8e4be44a default
parent child Browse files
Show More
@@ -461,9 +461,9 def start(ui, dirstate, root, opts):
461 461 self.master.shutdown()
462 462
463 463 if 'inserve' not in sys.argv:
464 runargs = [sys.argv[0], 'inserve', '-R', root]
464 runargs = util.hgcmd() + ['inserve', '-R', root]
465 465 else:
466 runargs = sys.argv[:]
466 runargs = util.hgcmd() + sys.argv[1:]
467 467
468 468 pidfile = ui.config('inotify', 'pidfile')
469 469 if opts['daemon'] and pidfile is not None and 'pid-file' not in runargs:
@@ -572,7 +572,7 def service(opts, parentfn=None, initfn=
572 572 os.close(lockfd)
573 573 try:
574 574 if not runargs:
575 runargs = sys.argv[:]
575 runargs = util.hgcmd() + sys.argv[1:]
576 576 runargs.append('--daemon-pipefds=%s' % lockpath)
577 577 # Don't pass --cwd to the child process, because we've already
578 578 # changed directory.
@@ -262,3 +262,5 def spawndetached(args):
262 262 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0),
263 263 args[0], args)
264 264
265 def gethgcmd():
266 return sys.argv[:1]
@@ -1274,3 +1274,14 def iterlines(iterator):
1274 1274
1275 1275 def expandpath(path):
1276 1276 return os.path.expanduser(os.path.expandvars(path))
1277
1278 def hgcmd():
1279 """Return the command used to execute current hg
1280
1281 This is different from hgexecutable() because on Windows we want
1282 to avoid things opening new shell windows like batch files, so we
1283 get either the python call or current executable.
1284 """
1285 if main_is_frozen():
1286 return [sys.executable]
1287 return gethgcmd()
@@ -352,6 +352,9 def spawndetached(args):
352 352 STARTUPINFO())
353 353 return pid
354 354
355 def gethgcmd():
356 return [sys.executable] + sys.argv[:1]
357
355 358 try:
356 359 # override functions with win32 versions if possible
357 360 from win32 import *
General Comments 0
You need to be logged in to leave comments. Login now