240 hgenv = os.environ.copy() |
240 hgenv = os.environ.copy() |
241 # Use HGPLAIN to disable hgrc settings that would change output formatting, |
241 # Use HGPLAIN to disable hgrc settings that would change output formatting, |
242 # and disable localization for the same reasons. |
242 # and disable localization for the same reasons. |
243 hgenv['HGPLAIN'] = '1' |
243 hgenv['HGPLAIN'] = '1' |
244 hgenv['LANGUAGE'] = 'C' |
244 hgenv['LANGUAGE'] = 'C' |
|
245 # PYTHONPATH and co can be used for isolated builds, which can break hg |
|
246 hgenv.pop("PYTHONNOUSERSITE", None) |
|
247 if "PYTHONPATH" in hgenv: |
|
248 hgenv["PYTHONPATH"] = os.pathsep.join( |
|
249 [ |
|
250 path |
|
251 for path in hgenv["PYTHONPATH"].split(os.pathsep) |
|
252 if "-build-env-" not in path |
|
253 ] |
|
254 ) |
245 hgcmd = ['hg'] |
255 hgcmd = ['hg'] |
246 # Run a simple "hg log" command just to see if using hg from the user's |
256 # Run a simple "hg log" command just to see if using hg from the user's |
247 # path works and can successfully interact with this repository. Windows |
257 # path works and can successfully interact with this repository. Windows |
248 # gives precedence to hg.exe in the current directory, so fall back to the |
258 # gives precedence to hg.exe in the current directory, so fall back to the |
249 # python invocation of local hg, where pythonXY.dll can always be found. |
259 # python invocation of local hg, where pythonXY.dll can always be found. |