Patchwork [2,of,2] test-split: stabilize for Windows

login
register
mail settings
Submitter Matt Harbison
Date Dec. 22, 2017, 7:55 a.m.
Message ID <feaadb8201a95e7a3f36.1513929353@Envy>
Download mbox | patch
Permalink /patch/26394/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 22, 2017, 7:55 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1513928288 18000
#      Fri Dec 22 02:38:08 2017 -0500
# Node ID feaadb8201a95e7a3f36ab3d62c1f942c4faa297
# Parent  e3de939009d730b1e26ba37b59a0d2178adef6ef
test-split: stabilize for Windows

 - $PYTHON needs to be quoted when used as an executable in $HGEDITOR.  This
   avoids the error "'c' is not recognized as an internal or external command".

 - seq.py is printing out CRLF, and then the subsequent `sed` script seems to
   convert to LF on MSYS.  IDK if python print statements can be made to print
   LF on Windows, and I'm pretty sure CRLF is baked into some other tests.

 - A stray glob was causing the 'obsstore-off' case to report 'no result code
   from test'.

 - When I ran with --debug, the `hg diff` commands in the test both printed
   color sequences, and paused the output as it was run through the pager.

Patch

diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -20,6 +20,8 @@ 
   > split=
   > [ui]
   > interactive=1
+  > color=no
+  > paginate=never
   > [diff]
   > git=1
   > unified=0
@@ -57,9 +59,10 @@ 
   abort: cannot split working directory
   [255]
 
-Generate some content
+Generate some content.  The sed filter drop CR on Windows, which is dropped in
+the a > b line.
 
-  $ $TESTDIR/seq.py 1 5 >> a
+  $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a
   $ hg ci -m a1 -A a -q
   $ hg bookmark -i r1
   $ sed 's/1/11/;s/3/33/;s/5/55/' a > b
@@ -132,7 +135,7 @@ 
   [255]
   $ hg status
 
-  $ HGEDITOR="$PYTHON $TESTTMP/editor.py"
+  $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
   $ runsplit
   diff --git a/a b/a
   1 hunks, 1 lines changed
@@ -197,7 +200,7 @@ 
   EDITOR: HG: user: test
   EDITOR: HG: branch 'default'
   EDITOR: HG: changed a
-  saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (glob) (obsstore-off !)
+  saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !)
 
 #if obsstore-off
   $ hg bookmark