[PATCH 06 of 11 STABLE] tests: use "sh -c 'script'" style to evaluate "$HG_ARGS" correctly anywhere

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Oct 23 12:53:20 CDT 2014


At Mon, 20 Oct 2014 16:04:47 +0200,
Mads Kiilerich wrote:
> 
> On 10/20/2014 03:27 PM, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1413810488 -32400
> > #      Mon Oct 20 22:08:08 2014 +0900
> > # Branch stable
> > # Node ID e5555e390871e982270f94cd62bfd771faa97f0b
> > # Parent  da9791c9eb40fc5f2fdb89b97b487e80dcd1a04d
> > tests: use "sh -c 'script'" style to evaluate "$HG_ARGS" correctly anywhere
> >
> > Before this patch, a part of "test-alias.t" fails unexpectedly on
> > Windows environment, because "cmd.exe" can't evaluate "$HG_ARGS"
> > expression in shell alias.
> >
> > This patch uses "sh -c 'script'" style to evaluate "$HG_ARGS"
> > expression correctly anywhere.
> >
> > diff --git a/tests/test-alias.t b/tests/test-alias.t
> > --- a/tests/test-alias.t
> > +++ b/tests/test-alias.t
> > @@ -395,7 +395,7 @@ command provided extension, should be ab
> >     > [extensions]
> >     > hgext.rebase =
> >     > [alias]
> > -  > rebate = !echo this is \$HG_ARGS
> > +  > rebate = !bash -c 'echo this is \$HG_ARGS'
> 
> We do (unfortunately) not depend on bash.
> 
> It would perhaps be more "correct" to test that native shell syntax 
> works and use %HG_ARGS% when on windows.

I'll send revised one.


> I guess this also means that the help for config.alias is incorrect. It 
> is not ' "$HG" expands to ' but more like ' the HG environment variable 
> is set to '.

What about the notation "$FOO" instead of "environment variable FOO"
in other help document ? Should we also replace them for
understand-ability of users (especially on Windows) ?

Of course, we should replace them after this code freeze period,
because this may cause trivial mistakes in changes and/or overwork of
translators in a short period, even if it is useful :-)


> /Mads
> 
> 

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list