##// END OF EJS Templates
setup: fix f51d1822d6fd refactoring, propagate env to runcmd
Christian Boos -
r9807:f359d4f5 default
parent child Browse files
Show More
@@ -97,7 +97,7 b' try:'
97 except ImportError:
97 except ImportError:
98 pass
98 pass
99
99
100 def runcmd(cmd):
100 def runcmd(cmd, env):
101 p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
101 p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
102 stderr=subprocess.PIPE, env=env)
102 stderr=subprocess.PIPE, env=env)
103 out, err = p.communicate()
103 out, err = p.communicate()
@@ -127,7 +127,7 b" if os.path.isdir('.hg'):"
127 # error 0xc0150004. See: http://bugs.python.org/issue3440
127 # error 0xc0150004. See: http://bugs.python.org/issue3440
128 env['SystemRoot'] = os.environ['SystemRoot']
128 env['SystemRoot'] = os.environ['SystemRoot']
129 cmd = [sys.executable, 'hg', 'id', '-i', '-t']
129 cmd = [sys.executable, 'hg', 'id', '-i', '-t']
130 l = runcmd(cmd).split()
130 l = runcmd(cmd, env).split()
131 while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
131 while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
132 l.pop()
132 l.pop()
133 if len(l) > 1: # tag found
133 if len(l) > 1: # tag found
@@ -137,7 +137,7 b" if os.path.isdir('.hg'):"
137 elif len(l) == 1: # no tag found
137 elif len(l) == 1: # no tag found
138 cmd = [sys.executable, 'hg', 'parents', '--template',
138 cmd = [sys.executable, 'hg', 'parents', '--template',
139 '{latesttag}+{latesttagdistance}-']
139 '{latesttag}+{latesttagdistance}-']
140 version = runcmd(cmd) + l[0]
140 version = runcmd(cmd, env) + l[0]
141 if version.endswith('+'):
141 if version.endswith('+'):
142 version += time.strftime('%Y%m%d')
142 version += time.strftime('%Y%m%d')
143 elif os.path.exists('.hg_archival.txt'):
143 elif os.path.exists('.hg_archival.txt'):
General Comments 0
You need to be logged in to leave comments. Login now