[PATCH 2 of 8] tests: quote paths in shell script hooks

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Tue Apr 4 13:39:54 EDT 2017


At Sun, 02 Apr 2017 20:45:58 -0400,
Matt Harbison wrote:
> 
> On Sun, 02 Apr 2017 20:41:29 -0400, Jun Wu <quark at fb.com> wrote:
> 
> > Excerpts from Matt Harbison's message of 2017-04-02 19:12:48 -0400:
> >> # HG changeset patch
> >> # User Matt Harbison <matt_harbison at yahoo.com>
> >> # Date 1491074606 14400
> >> #      Sat Apr 01 15:23:26 2017 -0400
> >> # Node ID 54fd6d15228e8e2f8e735beac0db0930c60af9ad
> >> # Parent  46f601b676cecfcc318f6852fe6ab6962703d2be
> >> tests: quote paths in shell script hooks
> >>
> >> Without the quoting, MSYS will remove the '\' directory separators, and  
> >> the repo
> >> can't be opened.
> >>
> >> diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
> >> --- a/tests/test-bookmarks.t
> >> +++ b/tests/test-bookmarks.t
> >> @@ -924,9 +924,9 @@
> >>
> >>    $ cat > $TESTTMP/checkpending.sh <<EOF
> >>    > echo "@repo"
> >> -  > hg -R $TESTTMP/repo bookmarks
> >> +  > hg -R "$TESTTMP/repo" bookmarks
> >>    > echo "@unrelated"
> >> -  > hg -R $TESTTMP/unrelated bookmarks
> >> +  > hg -R "$TESTTMP/unrelated" bookmarks
> >
> > Maybe this is worth a check-code rule.
> 
> It would definitely be nice, but I'm not sure how to do that and limit the  
> scope.  Not every instance of $TESTTMP/.. needs quoting- just the ones in  
> things that will be executed by the shell.

With current check-code implementation, all here-doc fragments in *.t
script are completely ignored, because all non-whitespace letters in
here-doc are replaced with 'x' by rephere() at filtering stage of
checkfile().

  https://www.mercurial-scm.org/repo/hg/file/68f263f52d2e/contrib/check-code.py#l96

This ignorance may cause overlooking outdated here-doc python code in
*.t script, too.

In fact, I have a suspending series to check here-doc fragments in *.t
script. I'll finish it in a hurry!

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

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


More information about the Mercurial-devel mailing list