[PATCH 3 of 4] Find right hg command for detached process

Patrick Mézard pmezard at gmail.com
Tue Jan 12 01:54:24 CST 2010


Le 12/01/10 04:51, Nicolas Dumazet a écrit :
> hello!
> 
> 2010/1/11 Patrick Mezard <pmezard at gmail.com>:
> 
>> +def hgcmd():
>> +    """Return the command used to execute current hg
>> +
>> +    This is different from hgexecutable() because on Windows we want
>> +    to avoid things opening new shell windows like batch files, so we
>> +    get either the python call or current executable.
>> +    """
>> +    if main_is_frozen():
>> +        return sys.executable
>> +    return gethgcmd()
> 
> what about util.hgexecutable() ?
> Isn't it doing something very similar?
> 
> If the result is somehow different, i'd like to include the behavior
> you want in hgexecutable, possibly with an optional parameter?

I wanted to do this too but:
- They behave differently, in my case hgexecutable() == 'c:\python25\scripts\hg.bat' while hgcmd() == ['c:\python25\python.exe', 'c:\python25\scripts\hg']
- hgcmd() returns multiple parameters, that's hard to reconciliate with hgexecutable() and $HG without escaping them as a command line, which would make the whole spawndetached() thing harder to implement.

--
Patrick Mézard


More information about the Mercurial-devel mailing list