Patchwork [3,of,5] test-extdiff: narrow the range of an '#if execbit' block

login
register
mail settings
Submitter Matt Harbison
Date May 7, 2017, 5:07 a.m.
Message ID <92c8d644b608273f7e18.1494133632@Envy>
Download mbox | patch
Permalink /patch/20513/
State Accepted
Headers show

Comments

Matt Harbison - May 7, 2017, 5:07 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1494112319 14400
#      Sat May 06 19:11:59 2017 -0400
# Node ID 92c8d644b608273f7e189878d5a1edb98c4a0f46
# Parent  4d135cddc4cdf3a41e53bd601b7b9a898ad9bc9b
test-extdiff: narrow the range of an '#if execbit' block

Now that output can be conditionalized, the few `chmod +x` specific outputs can
be conditionalized, and the rest of the tests run as normal.  Disable one test
that is failing on Windows for now.

Patch

diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t
--- a/tests/test-extdiff.t
+++ b/tests/test-extdiff.t
@@ -215,14 +215,15 @@ 
   running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !)
   running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !)
 
-#if execbit
 
 Test extdiff of multiple files in tmp dir:
 
   $ hg update -C 0 > /dev/null
   $ echo changed > a
   $ echo changed > b
+#if execbit
   $ chmod +x b
+#endif
 
 Diff in working directory, before:
 
@@ -234,8 +235,8 @@ 
   -a
   +changed
   diff --git a/b b/b
-  old mode 100644
-  new mode 100755
+  old mode 100644 (execbit !)
+  new mode 100755 (execbit !)
   --- a/b
   +++ b/b
   @@ -1,1 +1,1 @@
@@ -255,7 +256,9 @@ 
   > file('a/b', 'ab').write('edited\n')
   > EOT
 
+#if execbit
   $ chmod +x 'diff tool.py'
+#endif
 
 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
 and start tool
@@ -274,8 +277,8 @@ 
   +changed
   +edited
   diff --git a/b b/b
-  old mode 100644
-  new mode 100755
+  old mode 100644 (execbit !)
+  new mode 100755 (execbit !)
   --- a/b
   +++ b/b
   @@ -1,1 +1,2 @@
@@ -286,31 +289,37 @@ 
 Test extdiff with --option:
 
   $ hg extdiff -p echo -o this -c 1
-  this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
+  this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
+  this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
   [1]
 
   $ hg falabala -o this -c 1
-  diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
+  diffing this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
+  diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
   [1]
 
 Test extdiff's handling of options with spaces in them:
 
   $ hg edspace -c 1
-  name  <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
+  "name  <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
+  name  <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
   [1]
 
   $ hg extdiff -p echo -o "name  <user@example.com>" -c 1
-  name  <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
+  "name  <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
+  name  <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
   [1]
 
 Test with revsets:
 
   $ hg extdif -p echo -c "rev(1)"
-  */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
+  "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
+  */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
   [1]
 
   $ hg extdif -p echo -r "0::1"
-  */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
+  "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
+  */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
   [1]
 
 Fallback to merge-tools.tool.executable|regkey
@@ -319,8 +328,14 @@ 
   > #!/bin/sh
   > echo "** custom diff **"
   > EOF
+#if execbit
   $ chmod +x dir/tool.sh
+#endif
   $ tool=`pwd`/dir/tool.sh
+
+TODO: Fix this on Windows.  It currently tries to run 'tl a.* a', instead of
+falling back to tool.sh
+#if no-windows
   $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
   making snapshot of 2 files from rev * (glob)
     a
@@ -332,11 +347,10 @@ 
   ** custom diff **
   cleaning up temp directory
   [1]
+#endif
 
   $ cd ..
 
-#endif
-
 #if symlink
 
 Test symlinks handling (issue1909)