Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 10239:8e4be44a676f
Find right hg command for detached process
On Windows, Mercurial can be run from the python script of from a frozen
executable. In the first case, we have to call the python interpreter since the
script is not executable. Frozen executable can be called directly.
Fix 3/3 for issue421
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 21:11:58 +0100 |
parents | c2e2a5e6c36b |
children | 3af4b39afe2a |
comparison
equal
deleted
inserted
replaced
10238:e22695b4472f | 10239:8e4be44a676f |
---|---|
1272 for line in chunk.splitlines(): | 1272 for line in chunk.splitlines(): |
1273 yield line | 1273 yield line |
1274 | 1274 |
1275 def expandpath(path): | 1275 def expandpath(path): |
1276 return os.path.expanduser(os.path.expandvars(path)) | 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() |