tests: remove 'hghave symlink' from test-import-git.t
authorMads Kiilerich <mads@kiilerich.com>
Sun, 10 Jun 2012 18:59:51 +0200
changeset 16910 ad229181ddbe
parent 16909 b6fd2f8909ff
child 16911 39d38f16a3f7
tests: remove 'hghave symlink' from test-import-git.t The test had a long chain of commits depending on execbits in some of first commits. The hashes are checked throughout the file, so there was no elegant way to make it pass both with and without execbits. We now rollback the execbits-or-not commits and make a stable change instead. The hash chain is thus updated once but is now a bit more stable. The test coverage should be unaltered.
tests/test-import-git.t
--- a/tests/test-import-git.t	Sun Jun 10 18:59:13 2012 +0200
+++ b/tests/test-import-git.t	Sun Jun 10 18:59:51 2012 +0200
@@ -1,6 +1,5 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
-  $ hg init
+  $ hg init repo
+  $ cd repo
 
 New file:
 
@@ -41,14 +40,19 @@
   > EOF
   applying patch from stdin
 
+#if execbit
   $ hg tip -q
   2:3a34410f282e
-
   $ test -x new
+  $ hg rollback -q
+#else
+  $ hg tip -q
+  1:ab199dc869b5
+#endif
 
-Copy:
+Copy and removing x bit:
 
-  $ hg import -d "1000000 0" -mcopy - <<EOF
+  $ hg import -f -d "1000000 0" -mcopy - <<EOF
   > diff --git a/new b/copy
   > old mode 100755
   > new mode 100644
@@ -62,16 +66,37 @@
   > EOF
   applying patch from stdin
 
-  $ hg tip -q
-  3:37bacb7ca14d
-
+  $ test -f copy
 #if execbit
-  $ test -f copy
   $ test ! -x copy
   $ test -x copyx
+  $ hg tip -q
+  2:21dfaae65c71
 #else
+  $ hg tip -q
+  2:0efdaa8e3bf3
+#endif
+
+  $ hg up -qCr1
+  $ hg rollback -q
+
+Copy (like above but independent of execbit):
+
+  $ hg import -d "1000000 0" -mcopy - <<EOF
+  > diff --git a/new b/copy
+  > similarity index 100%
+  > copy from new
+  > copy to copy
+  > diff --git a/new b/copyx
+  > similarity index 100%
+  > copy from new
+  > copy to copyx
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  2:0efdaa8e3bf3
   $ test -f copy
-#endif
 
   $ cat copy
   a
@@ -90,7 +115,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  4:47b81a94361d
+  3:b1f57753fad2
 
   $ hg locate
   copyx
@@ -112,7 +137,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  5:d9b001d98336
+  4:1bd1da94b9b2
 
   $ hg locate
   empty
@@ -139,7 +164,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  6:ebe901e7576b
+  5:46fe99cb3035
 
 Copy and modify:
 
@@ -162,7 +187,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  7:18f368958ecd
+  6:ffeb3197c12d
 
   $ hg cat copy2
   a
@@ -192,7 +217,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  8:c32b0d7e6f44
+  7:401aede9e6bb
 
   $ hg locate copy2
   [1]
@@ -216,10 +241,10 @@
   applying patch from stdin
 
   $ hg tip -q
-  9:034a6bf95330
+  8:2ef727e684e8
 
   $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
-  9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
+  8 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
 
   $ hg locate rename2 rename3 rename3-2
   rename3
@@ -260,7 +285,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  11:c39bce63e786
+  10:27377172366e
 
   $ cat foo2
   foo
@@ -289,7 +314,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  12:30b530085242
+  11:18b73a84b4ab
 
   $ hg manifest --debug | grep mbinary
   045c85ba38952325e126c70962cc0f9d9077bc67 644   mbinary1
@@ -309,7 +334,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  13:04750ef42fb3
+  12:47500ce1614e
 
   $ cat "foo bar"
   foo
@@ -332,7 +357,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  14:c4cd9cdeaa74
+  13:6757efb07ea9
 
   $ cat foo3
   foo
@@ -367,8 +392,8 @@
 Invalid base85 content
 
   $ hg rollback
-  repository tip rolled back to revision 15 (undo import)
-  working directory now based on revision 15
+  repository tip rolled back to revision 14 (undo import)
+  working directory now based on revision 14
   $ hg revert -aq
   $ hg import -d "1000000 0" -m invalid-binary - <<"EOF"
   > diff --git a/text2 b/binary2
@@ -533,6 +558,8 @@
   $ cat b
   b
 
+#if symlink
+
   $ ln -s b linkb
   $ hg add linkb
   $ hg ci -m addlinkb
@@ -555,6 +582,8 @@
   ? b.rej
   ? linkb.rej
 
+#endif
+
 Test corner case involving copies and multiple hunks (issue3384)
 
   $ hg revert -qa