[PATCH] test-rebase-interruptions: stabilize for Windows

Matt Harbison mharbison72 at gmail.com
Sat Jul 1 23:32:07 EDT 2017


On Sat, 01 Jul 2017 23:16:26 -0400, Yuya Nishihara <yuya at tcha.org> wrote:

> On Sat, 01 Jul 2017 21:29:37 -0400, Matt Harbison wrote:
>> On Sat, 01 Jul 2017 19:37:51 -0400, Sean Farley <sean at farley.io> wrote:
>> > Matt Harbison <mharbison72 at gmail.com> writes:
>> >> # HG changeset patch
>> >> # User Matt Harbison <matt_harbison at yahoo.com>
>> >> # Date 1498936389 14400
>> >> #      Sat Jul 01 15:13:09 2017 -0400
>> >> # Node ID 61ed2cc98fd17c50c7adf634d777d946781a9fc1
>> >> # Parent  77e666f943a6c246d7fc970a8a36cd8b2023e03b
>> >> test-rebase-interruptions: stabilize for Windows
>> >>
>> >> External hooks end up launching cmd.exe, which knows nothing about  
>> $VAR
>> >> syntax.
>> >> For some reason, I thought that Mercurial would substitute in the
>> >> value, in
>> >> order to paper over the platform difference.  But I can't find that  
>> in
>> >> the
>> >> documentation, and there's at least one other use of this pattern  
>> [1].
>> >>
>> >> [1]
>> >>  
>> https://www.mercurial-scm.org/repo/hg/file/tip/tests/test-histedit-fold.t#l477
>> >
>> > Huh. I would have thought that, too. Should that be something we do?
>>
>> Maybe it was aliases that I was thinking of, but that's not really env
>> related.  I haven't had a need for hooks yet, but I'd say yes, even if  
>> for
>> no other reason than it's one less mode of failure for Windows tests.  
>> :-)
>> Presumably, '\$foo' could be used to pass a literal $foo.
>
> That probably means reimplementing shell (or shell parsing, at least),  
> which
> I wouldn't like to. shlex doesn't support everything the Unix shell can  
> do.

I was thinking find all instances of $foo in the command.  If the match  
starts with '\', drop that character.  Otherwise, substitute with %foo%  
before calling CreateProcess().  Windows doesn't understand single  
quoting, and doesn't need spaces around %foo% to substitute.  Are there  
other special cases that I'm not thinking of?


More information about the Mercurial-devel mailing list