[PATCH 3 of 3] util: adjust hgcmd() to handle frozen Mercurial on OS X

Matt Harbison mharbison72 at gmail.com
Wed Jan 13 00:41:11 UTC 2016


On Tue, 12 Jan 2016 10:39:58 -0500, Augie Fackler <raf at durin42.com> wrote:

> On Mon, Jan 11, 2016 at 11:32:08AM -0600, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison at yahoo.com>
>> # Date 1452467739 18000
>> #      Sun Jan 10 18:15:39 2016 -0500
>> # Node ID d279695282ab51520cece490782e60833d1cdcff
>> # Parent  82944be0a4a6158bc9b2e0ce04fd108eea078805
>> util: adjust hgcmd() to handle frozen Mercurial on OS X
>
> Queued these, thanks. OOC, where are you going with this? TortoiseHG
> packaging for OS X?

Yep.  It pretty much seemed to work without these, but Yuya noticed that  
typing `hg debuginstall` in the log window reported errors.  2 and 3 were  
other things I noticed chasing that down.

>>
>> 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.
>>
>> diff --git a/mercurial/util.py b/mercurial/util.py
>> --- a/mercurial/util.py
>> +++ b/mercurial/util.py
>> @@ -2044,7 +2044,11 @@
>>      get either the python call or current executable.
>>      """
>>      if mainfrozen():
>> -        return [sys.executable]
>> +        if getattr(sys, 'frozen', None) == 'macosx_app':
>> +            # Env variable set by py2app
>> +            return [os.environ['EXECUTABLEPATH']]
>> +        else:
>> +            return [sys.executable]
>>      return gethgcmd()
>>
>>  def rundetached(args, condfn):
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> https://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list