##// END OF EJS Templates
setup: move environment computation into a helper function...
Adam Simpkins -
r33112:155d760d default
parent child Browse files
Show More
@@ -165,20 +165,23 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
172 env = {'HGMODULEPOLICY': 'py',
171 # care to not use any hgrc files and do no localization.
173 'HGRCPATH': '',
172 env = {'HGMODULEPOLICY': 'py',
174 'LANGUAGE': 'C',
173 'HGRCPATH': '',
175 'PATH': ''} # make pypi modules that use os.environ['PATH'] happy
174 'LANGUAGE': 'C',
176 if 'LD_LIBRARY_PATH' in os.environ:
175 'PATH': ''} # make pypi modules that use os.environ['PATH'] happy
177 env['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
176 if 'LD_LIBRARY_PATH' in os.environ:
178 if 'SystemRoot' in os.environ:
177 env['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
179 # SystemRoot is required by Windows to load various DLLs. See:
178 if 'SystemRoot' in os.environ:
180 # https://bugs.python.org/issue13524#msg148850
179 # SystemRoot is required by Windows to load various DLLs. See:
181 env['SystemRoot'] = os.environ['SystemRoot']
180 # https://bugs.python.org/issue13524#msg148850
181 env['SystemRoot'] = os.environ['SystemRoot']
182
183 env = gethgenv()
184 version = ''
182
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']
General Comments 0
You need to be logged in to leave comments. Login now