comparison mercurial/util.py @ 27766:198f78a52a2f

util: adjust hgcmd() to handle frozen Mercurial on OS X Previously, 'hg serve -d' was trying to exec the bundled python executable, which failed with: Unknown option: -- usage: python [option] ... Try 'python -h'... abort: child process failed to start See the previous patch for details about the content of the various command variables. Note that unlike the previous patch here an application bundling Mercurial could set $HG in the environment to get the correct result, there isn't anything that a bundling application could do to get the correct result here. 'hg serve -d' now launches under TortoiseHg, and there is a process listed in the background, but a client process cannot connect to it for some reason, so more investigation is needed.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 10 Jan 2016 18:15:39 -0500
parents f1fb93eebb1d
children 5ef99738a562
comparison
equal deleted inserted replaced
27765:f1fb93eebb1d 27766:198f78a52a2f
2042 This is different from hgexecutable() because on Windows we want 2042 This is different from hgexecutable() because on Windows we want
2043 to avoid things opening new shell windows like batch files, so we 2043 to avoid things opening new shell windows like batch files, so we
2044 get either the python call or current executable. 2044 get either the python call or current executable.
2045 """ 2045 """
2046 if mainfrozen(): 2046 if mainfrozen():
2047 return [sys.executable] 2047 if getattr(sys, 'frozen', None) == 'macosx_app':
2048 # Env variable set by py2app
2049 return [os.environ['EXECUTABLEPATH']]
2050 else:
2051 return [sys.executable]
2048 return gethgcmd() 2052 return gethgcmd()
2049 2053
2050 def rundetached(args, condfn): 2054 def rundetached(args, condfn):
2051 """Execute the argument list in a detached process. 2055 """Execute the argument list in a detached process.
2052 2056