##// END OF EJS Templates
setup: move environment computation into a helper function...
Adam Simpkins -
r33112:155d760d default
parent child Browse files
Show More
@@ -165,10 +165,10 b' def runhg(cmd, env):'
165 return ''
165 return ''
166 return out
166 return out
167
167
168 version = ''
169
168
170 # Execute hg out of this directory with a custom environment which takes care
169 def gethgenv():
171 # to not use any hgrc files and do no localization.
170 # Execute hg out of this directory with a custom environment which takes
171 # care to not use any hgrc files and do no localization.
172 env = {'HGMODULEPOLICY': 'py',
172 env = {'HGMODULEPOLICY': 'py',
173 'HGRCPATH': '',
173 'HGRCPATH': '',
174 'LANGUAGE': 'C',
174 'LANGUAGE': 'C',
@@ -180,6 +180,9 b" if 'SystemRoot' in os.environ:"
180 # https://bugs.python.org/issue13524#msg148850
180 # https://bugs.python.org/issue13524#msg148850
181 env['SystemRoot'] = os.environ['SystemRoot']
181 env['SystemRoot'] = os.environ['SystemRoot']
182
182
183 env = gethgenv()
184 version = ''
185
183 if os.path.isdir('.hg'):
186 if os.path.isdir('.hg'):
184 cmd = [sys.executable, 'hg', 'log', '-r', '.', '--template', '{tags}\n']
187 cmd = [sys.executable, 'hg', 'log', '-r', '.', '--template', '{tags}\n']
185 numerictags = [t for t in runhg(cmd, env).split() if t[0:1].isdigit()]
188 numerictags = [t for t in runhg(cmd, env).split() if t[0:1].isdigit()]
General Comments 0
You need to be logged in to leave comments. Login now