Patchwork [1,of,7,STABLE] execute hghave with same env vars as ones for actual tests

mail settings
Submitter Katsunori FUJIWARA
Date Jan. 21, 2015, 3:10 p.m.
Message ID <0e281842c40a177bfbf7.1421853048@juju>
Download mbox | patch
Permalink /patch/7527/
State Accepted
Commit 769027075e2183799e40bfad188df80cf4de40ae
Headers show


Katsunori FUJIWARA - Jan. 21, 2015, 3:10 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <>
# Date 1421852638 -32400
#      Thu Jan 22 00:03:58 2015 +0900
# Branch stable
# Node ID 0e281842c40a177bfbf7d062dadc04e2febc5aad
# Parent  a43fdf33a6beb697945a3dbb7253f0436ea278a6 execute hghave with same env vars as ones for actual tests

Before this patch, "" executes "hghave" process without
any modifications for environment variables, even though actual tests
are executed with LC_ALL, LANG and LANGUAGE explicitly assigned "C".

When "" is executed:

  - with non-"C" locale environment variables on any platforms, or

  - without any explicit locale environment setting on Windows
    (only for "outer-repo" feature using "hg root")

external commands indirectly executed by "hghave" may show translated

This causes incorrect "hghave" result and skipping tests, because some
regexp matching of "hghave" expect external commands to show
un-translated messages.

To prevent external commands from showing translated messages, this
patch makes "" execute "hghave" with same environment
variables as ones for actual tests.

This patch doesn't make "hghave" execute external commands forcibly
with LC_ALL, LANG and LANGUAGE explicitly assigned "C", because
changing "" is cheaper than changing "hghave":

  - "os.popen" should be replaced by "subprocess.Popen" or so, and
  - setting up environment variables should be newly added


diff --git a/tests/ b/tests/
--- a/tests/
+++ b/tests/
@@ -786,7 +786,7 @@  class TTest(Test):
         tdir = self._testdir.replace('\\', '/')
         proc = Popen4('%s -c "%s/hghave %s"' %
                       (self._shell, tdir, ' '.join(reqs)),
-                      self._testtmp, 0)
+                      self._testtmp, 0, self._getenv())
         stdout, stderr = proc.communicate()
         ret = proc.wait()
         if wifexited(ret):