[PATCH] tests: more completely restore the environment in syshgenv

Adam Simpkins simpkins at fb.com
Fri Jun 30 14:28:56 EDT 2017


On Jun 29, Matt Harbison wrote:
> On Thu, 29 Jun 2017 15:21:10 -0400, Adam Simpkins <simpkins at fb.com> wrote:
> 
> >On Jun 29, Matt Harbison wrote:
> >>On Wed, 28 Jun 2017 15:34:56 -0400, Adam Simpkins
> >><simpkins at fb.com> wrote:
> >>
> >>># HG changeset patch
> >>># User Adam Simpkins <simpkins at fb.com>
> >>># Date 1498677802 25200
> >>>#      Wed Jun 28 12:23:22 2017 -0700
> >>># Node ID 236c593941ab8034c500039c54bee0b3a19a0cef
> >>># Parent  649cb52c8cd94ab98068004e40bf9947de62a0ce
> >>>tests: more completely restore the environment in syshgenv
> >>>
> >>...
> >>
> >>>diff --git a/tests/run-tests.py b/tests/run-tests.py
> >>>--- a/tests/run-tests.py
> >>>+++ b/tests/run-tests.py
> >>...
> 
> >>--- c:/Users/Matt/projects/hg/tests/test-check-code.t
> >>+++ c:/Users/Matt/projects/hg/tests/test-check-code.t.err
> >>@@ -9,6 +9,8 @@
> >>
> >>   $ syshg locate -X contrib/python-zstandard -X
> >>hgext/fsmonitor/pywatchman |
> >>   > sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
> >>+
> >>C:\Users\Matt\AppData\Local\Temp\hgtests.jjx4mu\child1\restoreenv.sh:
> >>line 17: syntax error near unexpected token `X86'
> >>+
> >>C:\Users\Matt\AppData\Local\Temp\hgtests.jjx4mu\child1\restoreenv.sh:
> >>line 17: `PROGRAMFILES(X86)='C:\Program Files (x86)''
> >>   Skipping i18n/polib.py it has no-che?k-code (glob)
> >>   Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob)
> >>   Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob)
> >
> >That's actually a little interesting, since Windows appears to have an
> >environment variable with a '(' character in it.  I believe sh doesn't
> >allow setting variables with '(' characters.  For now I think we'll
> >just have to live with not restoring these variables.
> 
> That seems OK, but we probably need to support it on the value side
> for things like $PATH.

Yeah, special characters on the value side are allowed and should be
fine as long as we quote them properly.  There are only limitations
on what can be in the variable name, not the value.


> Here's the Windows test system for reference, complete with
> variables, including a multiline(!) one.
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__buildbot.mercurial-2Dscm.org_builders_Win7-2520x86-5F64-2520hg-2520tests_builds_27_steps_run-2Dtests.py-2520-2528python-25202.7.13-2529_logs_stdio&d=DwICbA&c=5VD0RTtNlTh3ycd41b3MUw&r=scVZZiST905ART2dKi84ig&m=hpMyfjq0ZHEnzJnw1kAm8seObde7bpS6k3IRy79Yr7c&s=-Jr4IcRXTe1wyBjKHP1A8yyhdF09aa6B6R5OEEffMF4&e=
> 
> (To the other thread, IDR if I enabled evolve on it.)

Ok, thanks for the link.  Between the regex fix and Yuya's latest
patch to restore $PATH correctly this should hopefully fix everything.

I had looked at the build bot results earlier, but didn't notice that
the Windows builds were failing with a different error than before.

-- 
Adam Simpkins
simpkins at fb.com


More information about the Mercurial-devel mailing list