[PATCH 1 of 2] setup: fix f51d1822d6fd refactoring, propagate env to runcmd

Christian Boos cboos at neuf.fr
Mon Nov 9 11:33:09 CST 2009


# HG changeset patch
# User Christian Boos <cboos at bct-technology.com>
# Date 1257784396 -3600
# Node ID 3e114d36f982e11696b359a408f69f6a45b6e071
# Parent  4ce13d7c6b8855e028dd284e03d416400fcb5225
setup: fix f51d1822d6fd refactoring, propagate env to runcmd

diff -r 4ce13d7c6b88 -r 3e114d36f982 setup.py
--- a/setup.py	Sun Nov 08 18:50:39 2009 +0100
+++ b/setup.py	Mon Nov 09 17:33:16 2009 +0100
@@ -97,7 +97,7 @@
 except ImportError:
     pass
 
-def runcmd(cmd):
+def runcmd(cmd, env):
     p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE, env=env)
     out, err = p.communicate()
@@ -127,7 +127,7 @@
         # error 0xc0150004. See: http://bugs.python.org/issue3440
         env['SystemRoot'] = os.environ['SystemRoot']
     cmd = [sys.executable, 'hg', 'id', '-i', '-t']
-    l = runcmd(cmd).split()
+    l = runcmd(cmd, env).split()
     while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
         l.pop()
     if len(l) > 1: # tag found
@@ -137,7 +137,7 @@
     elif len(l) == 1: # no tag found
         cmd = [sys.executable, 'hg', 'parents', '--template',
                '{latesttag}+{latesttagdistance}-']
-        version = runcmd(cmd) + l[0]
+        version = runcmd(cmd, env) + l[0]
     if version.endswith('+'):
         version += time.strftime('%Y%m%d')
 elif os.path.exists('.hg_archival.txt'):


More information about the Mercurial-devel mailing list