[PATCH 3 of 4] tests: use new possibility of condition in output

Simon Heimberg simohe at besonet.ch
Mon Feb 3 18:14:19 CST 2014


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1391472515 -3600
#      Tue Feb 04 01:08:35 2014 +0100
# Branch stable
# Node ID 7662e108fceac6850555359f0e668083b0f22598
# Parent  94c2bb6ad0656684bdc90bb52a1a205a5ad151e3
tests: use new possibility of condition in output

The similar output inside of test-import.t and of test-record.t is much smaller
now. The comment from the old "else" case has been moved near the first or last
condition.

In the other tests, the differences between the cases are highlighted more
clearly now, because inside the condition are no common lines anymore.

diff -r 94c2bb6ad065 -r 7662e108fcea tests/test-clone.t
--- a/tests/test-clone.t	Tue Feb 04 00:26:51 2014 +0100
+++ b/tests/test-clone.t	Tue Feb 04 01:08:35 2014 +0100
@@ -48,15 +48,13 @@
 
 No update, with debug option:
 
+  $ hg --debug clone -U . ../c
 #if hardlink
-  $ hg --debug clone -U . ../c
   linked 8 files
+#else
+  copied 8 files
+#endif
   listing keys for "bookmarks"
-#else
-  $ hg --debug clone -U . ../c
-  copied 8 files
-  listing keys for "bookmarks"
-#endif
   $ cd ../c
   $ cat a 2>/dev/null || echo "a not present"
   a not present
diff -r 94c2bb6ad065 -r 7662e108fcea tests/test-import.t
--- a/tests/test-import.t	Tue Feb 04 00:26:51 2014 +0100
+++ b/tests/test-import.t	Tue Feb 04 01:08:35 2014 +0100
@@ -909,10 +909,12 @@
   > EOF
   applying patch from stdin
 
+  $ hg sum
 #if execbit
-
-  $ hg sum
   parent: 1:d59915696727 tip
+#else
+  parent: 1:28f089cc9ccc tip
+#endif
    help management of empty pkg and lib directories in perforce
   branch: default
   commit: (clean)
@@ -934,41 +936,16 @@
   +perforce does not maintain empty directories.
   +this file helps.
   diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
+#if execbit
   old mode 100644
   new mode 100755
-
-#else
-
-  $ hg sum
-  parent: 1:28f089cc9ccc tip
-   help management of empty pkg and lib directories in perforce
-  branch: default
-  commit: (clean)
-  update: (current)
-
-  $ hg diff --git -c tip
-  diff --git a/lib/place-holder b/lib/place-holder
-  new file mode 100644
-  --- /dev/null
-  +++ b/lib/place-holder
-  @@ -0,0 +1,2 @@
-  +perforce does not maintain empty directories.
-  +this file helps.
-  diff --git a/pkg/place-holder b/pkg/place-holder
-  new file mode 100644
-  --- /dev/null
-  +++ b/pkg/place-holder
-  @@ -0,0 +1,2 @@
-  +perforce does not maintain empty directories.
-  +this file helps.
-
+#endif
 /* The mode change for mksys.bash is missing here, because on platforms  */
 /* that don't support execbits, mode changes in patches are ignored when */
 /* they are imported. This is obviously also the reason for why the hash */
 /* in the created changeset is different to the one you see above the    */
 /* #else clause */
 
-#endif
   $ cd ..
 
 
diff -r 94c2bb6ad065 -r 7662e108fcea tests/test-mq.t
--- a/tests/test-mq.t	Tue Feb 04 00:26:51 2014 +0100
+++ b/tests/test-mq.t	Tue Feb 04 01:08:35 2014 +0100
@@ -932,27 +932,19 @@
 #endif
   $ hg add new
   $ hg qrefresh
-#if execbit
   $ cat .hg/patches/new
   new file
   
   diff --git a/new b/new
+#if execbit
   new file mode 100755
+#else
+  new file mode 100644
+#endif
   --- /dev/null
   +++ b/new
   @@ -0,0 +1,1 @@
   +foo
-#else
-  $ cat .hg/patches/new
-  new file
-  
-  diff --git a/new b/new
-  new file mode 100644
-  --- /dev/null
-  +++ b/new
-  @@ -0,0 +1,1 @@
-  +foo
-#endif
 
   $ hg qnew -m'copy file' copy
   $ hg cp new copy
diff -r 94c2bb6ad065 -r 7662e108fcea tests/test-paths.t
--- a/tests/test-paths.t	Tue Feb 04 00:26:51 2014 +0100
+++ b/tests/test-paths.t	Tue Feb 04 01:08:35 2014 +0100
@@ -24,13 +24,11 @@
   expand = $TESTTMP/a/foo/bar (glob)
 #if msys
   $ SOMETHING=//foo hg paths
+#else
+  $ SOMETHING=/foo hg paths
+#endif
   dupe = $TESTTMP/b (glob)
   expand = /foo/bar
-#else
-  $ SOMETHING=/foo hg paths
-  dupe = $TESTTMP/b (glob)
-  expand = /foo/bar
-#endif
   $ hg paths -q
   dupe
   expand
diff -r 94c2bb6ad065 -r 7662e108fcea tests/test-record.t
--- a/tests/test-record.t	Tue Feb 04 00:26:51 2014 +0100
+++ b/tests/test-record.t	Tue Feb 04 01:08:35 2014 +0100
@@ -779,11 +779,14 @@
   +a
   
 
-#if execbit
-
 Preserve chmod +x
 
+(When no execbit, do slightly bogus tests to get almost same repo structure as
+ when x bit is used - but with different hashes and no mode change.)
+
+#if execbit
   $ chmod +x f1
+#endif
   $ echo a >> f1
   $ hg record -d '20 0' -mz <<EOF
   > y
@@ -791,8 +794,10 @@
   > y
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
+#if execbit
   old mode 100644
   new mode 100755
+#endif
   1 hunks, 1 lines changed
   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   @@ -1,2 +1,3 @@
@@ -802,7 +807,11 @@
   record this change to 'subdir/f1'? [Ynesfdaq?] 
 
   $ hg tip --config diff.git=True -p
+#if execbit
   changeset:   22:3261adceb075
+#else
+  changeset:   22:0d463bd428f5
+#endif
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:20 1970 +0000
@@ -838,7 +847,11 @@
   record this change to 'subdir/f1'? [Ynesfdaq?] 
 
   $ hg tip --config diff.git=True -p
+#if execbit
   changeset:   23:b429867550db
+#else
+  changeset:   23:0eab41a3e524
+#endif
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:21 1970 +0000
@@ -864,8 +877,10 @@
   > y
   > EOF
   diff --git a/subdir/f1 b/subdir/f1
+#if execbit
   old mode 100755
   new mode 100644
+#endif
   1 hunks, 1 lines changed
   examine changes to 'subdir/f1'? [Ynesfdaq?] 
   @@ -2,3 +2,4 @@
@@ -876,15 +891,21 @@
   record this change to 'subdir/f1'? [Ynesfdaq?] 
 
   $ hg tip --config diff.git=True -p
+#if execbit
   changeset:   24:0b082130c20a
+#else
+  changeset:   24:f4f718f27b7c
+#endif
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:22 1970 +0000
   summary:     ab
   
   diff --git a/subdir/f1 b/subdir/f1
+#if execbit
   old mode 100755
   new mode 100644
+#endif
   --- a/subdir/f1
   +++ b/subdir/f1
   @@ -2,3 +2,4 @@
@@ -894,117 +915,6 @@
   +c
   
 
-#else
-
-Slightly bogus tests to get almost same repo structure as when x bit is used
-- but with different hashes.
-
-Mock "Preserve chmod +x"
-
-  $ echo a >> f1
-  $ hg record -d '20 0' -mz <<EOF
-  > y
-  > y
-  > y
-  > EOF
-  diff --git a/subdir/f1 b/subdir/f1
-  1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
-  @@ -1,2 +1,3 @@
-   a
-   a
-  +a
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
-
-  $ hg tip --config diff.git=True -p
-  changeset:   22:0d463bd428f5
-  tag:         tip
-  user:        test
-  date:        Thu Jan 01 00:00:20 1970 +0000
-  summary:     z
-  
-  diff --git a/subdir/f1 b/subdir/f1
-  --- a/subdir/f1
-  +++ b/subdir/f1
-  @@ -1,2 +1,3 @@
-   a
-   a
-  +a
-  
-
-Mock "Preserve execute permission on original"
-
-  $ echo b >> f1
-  $ hg record -d '21 0' -maa <<EOF
-  > y
-  > y
-  > y
-  > EOF
-  diff --git a/subdir/f1 b/subdir/f1
-  1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
-  @@ -1,3 +1,4 @@
-   a
-   a
-   a
-  +b
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
-
-  $ hg tip --config diff.git=True -p
-  changeset:   23:0eab41a3e524
-  tag:         tip
-  user:        test
-  date:        Thu Jan 01 00:00:21 1970 +0000
-  summary:     aa
-  
-  diff --git a/subdir/f1 b/subdir/f1
-  --- a/subdir/f1
-  +++ b/subdir/f1
-  @@ -1,3 +1,4 @@
-   a
-   a
-   a
-  +b
-  
-
-Mock "Preserve chmod -x"
-
-  $ chmod -x f1
-  $ echo c >> f1
-  $ hg record -d '22 0' -mab <<EOF
-  > y
-  > y
-  > y
-  > EOF
-  diff --git a/subdir/f1 b/subdir/f1
-  1 hunks, 1 lines changed
-  examine changes to 'subdir/f1'? [Ynesfdaq?] 
-  @@ -2,3 +2,4 @@
-   a
-   a
-   b
-  +c
-  record this change to 'subdir/f1'? [Ynesfdaq?] 
-
-  $ hg tip --config diff.git=True -p
-  changeset:   24:f4f718f27b7c
-  tag:         tip
-  user:        test
-  date:        Thu Jan 01 00:00:22 1970 +0000
-  summary:     ab
-  
-  diff --git a/subdir/f1 b/subdir/f1
-  --- a/subdir/f1
-  +++ b/subdir/f1
-  @@ -2,3 +2,4 @@
-   a
-   a
-   b
-  +c
-  
-
-#endif
-
   $ cd ..
 
 


More information about the Mercurial-devel mailing list