##// END OF EJS Templates
setup: set whole env for running hg even if .hg doesn't exist (issue3073)...
Yuya Nishihara -
r15388:eb6c0d47 stable
parent child Browse files
Show More
@@ -133,14 +133,13 b' def runhg(cmd, env):'
133 133
134 134 version = ''
135 135
136 env = {'HGRCPATH': '', 'LANGUAGE': 'C'}
137
138 if os.path.isdir('.hg'):
139 136 # Execute hg out of this directory with a custom environment which
140 137 # includes the pure Python modules in mercurial/pure. We also take
141 138 # care to not use any hgrc files and do no localization.
142 139 pypath = ['mercurial', os.path.join('mercurial', 'pure')]
143 env['PYTHONPATH'] = os.pathsep.join(pypath)
140 env = {'PYTHONPATH': os.pathsep.join(pypath),
141 'HGRCPATH': '',
142 'LANGUAGE': 'C'}
144 143 if 'LD_LIBRARY_PATH' in os.environ:
145 144 env['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
146 145 if 'SystemRoot' in os.environ:
@@ -148,6 +147,8 b" if os.path.isdir('.hg'):"
148 147 # under Windows. Otherwise, the subprocess will fail with
149 148 # error 0xc0150004. See: http://bugs.python.org/issue3440
150 149 env['SystemRoot'] = os.environ['SystemRoot']
150
151 if os.path.isdir('.hg'):
151 152 cmd = [sys.executable, 'hg', 'id', '-i', '-t']
152 153 l = runhg(cmd, env).split()
153 154 while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
General Comments 0
You need to be logged in to leave comments. Login now