[PATCH 2 of 8] tests: quote paths in shell script hooks
Matt Harbison
mharbison72 at gmail.com
Mon Apr 3 00:45:58 UTC 2017
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.
More information about the Mercurial-devel
mailing list