Patchwork [2,of,2] tests: partially stabilize test-fix-* for Windows

login
register
mail settings
Submitter Matt Harbison
Date March 31, 2018, 1:43 a.m.
Message ID <3262e4f5d83b86754e8d.1522460622@Envy>
Download mbox | patch
Permalink /patch/30034/
State Accepted
Headers show

Comments

Matt Harbison - March 31, 2018, 1:43 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1522458729 14400
#      Fri Mar 30 21:12:09 2018 -0400
# Node ID 3262e4f5d83b86754e8d4bd56ba651cf166a87d8
# Parent  d0bae217b58314cd50c43e345e754f2f373b0441
tests: partially stabilize test-fix-* for Windows

It looks like {rootpath} may not be getting translated on Windows.  But this
eliminates all of the other test spew.

  --- c:/Users/Matt/projects/hg/tests/test-fix.t
  +++ c:/Users/Matt/projects/hg/tests/test-fix.t.err
  @@ -465,7 +465,7 @@
     $ hg --config "fix.fail:command=sh $TESTTMP/cmd.sh {rootpath}" \
     >    --config "fix.fail:fileset=hello.txt" \
     >    fix --working-dir
  -  [wdir] fail: hello.txt: some
  +  [wdir] fail: : some
     [wdir] fail: error
     $ cat hello.txt
     hello
Yuya Nishihara - March 31, 2018, 2:21 a.m.
On Fri, 30 Mar 2018 21:43:42 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1522458729 14400
> #      Fri Mar 30 21:12:09 2018 -0400
> # Node ID 3262e4f5d83b86754e8d4bd56ba651cf166a87d8
> # Parent  d0bae217b58314cd50c43e345e754f2f373b0441
> tests: partially stabilize test-fix-* for Windows
> 
> It looks like {rootpath} may not be getting translated on Windows.  But this
> eliminates all of the other test spew.

This will conflict with D2988. Can you take a look?

https://phab.mercurial-scm.org/D2988
Matt Harbison - March 31, 2018, 2:58 a.m.
On Fri, 30 Mar 2018 22:21:51 -0400, Yuya Nishihara <yuya@tcha.org> wrote:

> On Fri, 30 Mar 2018 21:43:42 -0400, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison@yahoo.com>
>> # Date 1522458729 14400
>> #      Fri Mar 30 21:12:09 2018 -0400
>> # Node ID 3262e4f5d83b86754e8d4bd56ba651cf166a87d8
>> # Parent  d0bae217b58314cd50c43e345e754f2f373b0441
>> tests: partially stabilize test-fix-* for Windows
>>
>> It looks like {rootpath} may not be getting translated on Windows.  But  
>> this
>> eliminates all of the other test spew.
>
> This will conflict with D2988. Can you take a look?
>
> https://phab.mercurial-scm.org/D2988

My patch can be dropped.

Patch

diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -6,7 +6,7 @@  relationships. We indicate fixed file co
   > [extensions]
   > fix =
   > [fix]
-  > uppercase-whole-file:command=sed -e 's/.*/\U&/'
+  > uppercase-whole-file:command=sed -e "s/.*/\U&/"
   > uppercase-whole-file:fileset=set:**
   > EOF
 
diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -10,10 +10,10 @@  choose which behavior to use by naming f
   > evolution.createmarkers=True
   > evolution.allowunstable=True
   > [fix]
-  > uppercase-whole-file:command=sed -e 's/.*/\U&/'
+  > uppercase-whole-file:command=sed -e "s/.*/\U&/"
   > uppercase-whole-file:fileset=set:**.whole
   > uppercase-changed-lines:command=sed
-  > uppercase-changed-lines:linerange=-e '{first},{last} s/.*/\U&/'
+  > uppercase-changed-lines:linerange=-e "{first},{last} s/.*/\U&/"
   > uppercase-changed-lines:fileset=set:**.changed
   > EOF
 
@@ -458,8 +458,11 @@  print the filename if it is relevant.
   $ printf "hello\n" > hello.txt
   $ hg add
   adding hello.txt
-  $ hg --config "fix.fail:command=printf 'HELLO\n' ; \
-  >                               printf '{rootpath}: some\nerror' >&2" \
+  $ cat >> $TESTTMP/cmd.sh <<EOF
+  > printf 'HELLO\n'
+  > printf "$@: some\nerror" >&2
+  > EOF
+  $ hg --config "fix.fail:command=sh $TESTTMP/cmd.sh {rootpath}" \
   >    --config "fix.fail:fileset=hello.txt" \
   >    fix --working-dir
   [wdir] fail: hello.txt: some
@@ -878,7 +881,7 @@  useful for anyone trying to set up a new
   $ hg commit -Aqm "foo"
   $ printf "Foo\nbar\nBaz\n" > foo.changed
   $ hg --debug fix --working-dir
-  subprocess: sed -e '1,1 s/.*/\U&/' -e '3,3 s/.*/\U&/'
+  subprocess: sed -e "1,1 s/.*/\U&/" -e "3,3 s/.*/\U&/"
 
   $ cd ..