D6852: tests: stabilize test-fix.t on Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

D6852: tests: stabilize test-fix.t on Windows

martinvonz (Martin von Zweigbergk)
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `pwd` prints /tmp/... style paths, not C:\... needed for $TESTTMP to be
  substituted.
 
  In the final test, for whatever reason, Windows was missing EOL in the files and
  printing:
 
    [wdir] changedlines: printf: warning: ignoring excess arguments, starting
       with 'printf'
 
  even though it was trying to run:
 
    printf "Line ranges:\n"; printf "2 through 2\n";
 
  I tried wrapping both :command and :linerange in `sh -c "..."`, and while that
  fixed the missing EOL, it missed the "2 through 2" output.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6852

AFFECTED FILES
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1297,7 +1297,7 @@
 
   $ cat >> .hg/hgrc <<EOF
   > [fix]
-  > printcwd:command = pwd
+  > printcwd:command = "$PYTHON" -c "import os; print(os.getcwd())"
   > printcwd:pattern = path:foo/bar
   > EOF
 
@@ -1382,9 +1382,15 @@
   $ printf "a\nc\n" > foo
   $ printf "a\nx\nc\n" > baz
 
+  $ cat >> print.py <<EOF
+  > import sys
+  > for a in sys.argv[1:]:
+  >    print(a)
+  > EOF
+
   $ hg fix --working-dir foo bar baz \
-  >        --config 'fix.changedlines:command=printf "Line ranges:\n"; ' \
-  >        --config 'fix.changedlines:linerange=printf "{first} through {last}\n"; ' \
+  >        --config "fix.changedlines:command=\"$PYTHON\" print.py \"Line ranges:\"" \
+  >        --config 'fix.changedlines:linerange="{first} through {last}"' \
   >        --config 'fix.changedlines:pattern=rootglob:**' \
   >        --config 'fix.changedlines:skipclean=false'
 



To: mharbison72, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D6852: tests: stabilize test-fix.t on Windows

martinvonz (Martin von Zweigbergk)
Closed by commit rHGa2dffe68b4ea: tests: stabilize test-fix.t on Windows (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6852?vs=16545&id=16561

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6852/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6852

AFFECTED FILES
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -1297,7 +1297,7 @@
 
   $ cat >> .hg/hgrc <<EOF
   > [fix]
-  > printcwd:command = pwd
+  > printcwd:command = "$PYTHON" -c "import os; print(os.getcwd())"
   > printcwd:pattern = path:foo/bar
   > EOF
 
@@ -1382,9 +1382,15 @@
   $ printf "a\nc\n" > foo
   $ printf "a\nx\nc\n" > baz
 
+  $ cat >> print.py <<EOF
+  > import sys
+  > for a in sys.argv[1:]:
+  >    print(a)
+  > EOF
+
   $ hg fix --working-dir foo bar baz \
-  >        --config 'fix.changedlines:command=printf "Line ranges:\n"; ' \
-  >        --config 'fix.changedlines:linerange=printf "{first} through {last}\n"; ' \
+  >        --config "fix.changedlines:command=\"$PYTHON\" print.py \"Line ranges:\"" \
+  >        --config 'fix.changedlines:linerange="{first} through {last}"' \
   >        --config 'fix.changedlines:pattern=rootglob:**' \
   >        --config 'fix.changedlines:skipclean=false'
 



To: mharbison72, #hg-reviewers, pulkit
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel