# HG changeset patch # User Augie Fackler # Date 1303090084 18000 # Node ID 3bffdf0e5948b65ead839356ef09f6569873e398 # Parent 7bf283d4c7a91e8d0ad462bd1cf7efa9651b72d7 Backed out changeset 7bf283d4c7a9 in favor of a better win32 fix In the future I'll try to get commentary from Windows people *before* pushing a patch. diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -33,9 +33,6 @@ def runcmd(cmd, env): version = '' -HG_COMMAND = 'hg' -if os.name == 'nt': - HG_COMMAND = 'hg.bat' if os.path.isdir('.hg'): # Execute hg out of this directory with a custom environment which @@ -51,7 +48,7 @@ if os.path.isdir('.hg'): # under Windows. Otherwise, the subprocess will fail with # error 0xc0150004. See: http://bugs.python.org/issue3440 env['SystemRoot'] = os.environ['SystemRoot'] - cmd = [HG_COMMAND, 'id', '-i', '-t'] + cmd = ['hg', 'id', '-i', '-t'] l = runcmd(cmd, env).split() while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags l.pop() @@ -60,11 +57,11 @@ if os.path.isdir('.hg'): if l[0].endswith('+'): # propagate the dirty status to the tag version += '+' elif len(l) == 1: # no tag found - cmd = [HG_COMMAND, 'parents', '--template', + cmd = ['hg', 'parents', '--template', '{latesttag}+{latesttagdistance}-'] version = runcmd(cmd, env) + l[0] if not version: - version = runcmd([HG_COMMAND, 'parents', '--template' '{node|short}\n'], + version = runcmd(['hg', 'parents', '--template' '{node|short}\n'], env) if version: version = version.split()[0]