changeset 17014:50fbe9063ff2

tests: convert some 'hghave no-outer-repo' to #if In some places we instead use 'hg init' to create a well-known outer repo without any special extensions or other config settings.
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 20 Jun 2012 23:41:21 +0200
parents 88f650208c32
children 73d20de5f30b
files tests/test-convert-svn-sink.t tests/test-dispatch.t tests/test-extension.t tests/test-globalopts.t tests/test-glog.t tests/test-identify.t
diffstat 6 files changed, 32 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-convert-svn-sink.t	Wed Jun 20 12:30:16 2012 -0500
+++ b/tests/test-convert-svn-sink.t	Wed Jun 20 23:41:21 2012 +0200
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" svn13 no-outer-repo || exit 80
+  $ "$TESTDIR/hghave" svn13 || exit 80
 
   $ fixpath()
   > {
@@ -356,7 +356,7 @@
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
   [1]
   $ hg --cwd b revert -r 2 b
-  $ hg resolve -m b
+  $ hg --cwd b resolve -m b
   $ hg --cwd b ci -d '5 0' -m 'merge'
 
 Expect 4 changes
--- a/tests/test-dispatch.t	Wed Jun 20 12:30:16 2012 -0500
+++ b/tests/test-dispatch.t	Wed Jun 20 23:41:21 2012 +0200
@@ -1,9 +1,5 @@
 test command parsing and dispatch
 
-  $ "$TESTDIR/hghave" no-outer-repo || exit 80
-
-  $ dir=`pwd`
-
   $ hg init a
   $ cd a
 
@@ -48,6 +44,10 @@
   a: no such file in rev 000000000000
   [1]
 
+  $ cd "$TESTTMP"
+
+#if no-outer-repo
+
 No repo:
 
   $ cd $dir
@@ -55,3 +55,4 @@
   abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
 
+#endif
--- a/tests/test-extension.t	Wed Jun 20 12:30:16 2012 -0500
+++ b/tests/test-extension.t	Wed Jun 20 23:41:21 2012 +0200
@@ -1,7 +1,5 @@
 Test basic extension support
 
-  $ "$TESTDIR/hghave" no-outer-repo || exit 80
-
   $ cat > foobar.py <<EOF
   > import os
   > from mercurial import commands
@@ -132,6 +130,9 @@
 
   $ cd ..
 
+hide outer repo
+  $ hg init
+
   $ cat > empty.py <<EOF
   > '''empty cmdtable
   > '''
--- a/tests/test-globalopts.t	Wed Jun 20 12:30:16 2012 -0500
+++ b/tests/test-globalopts.t	Wed Jun 20 23:41:21 2012 +0200
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" no-outer-repo || exit 80
-
   $ hg init a
   $ cd a
   $ echo a > a
@@ -77,6 +75,8 @@
   8580ff50825a tip
   $ cd ..
 
+#if no-outer-repo
+
 Implicit -R:
 
   $ hg ann a/a
@@ -93,6 +93,8 @@
   abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
 
+#endif
+
 Abbreviation of long option:
 
   $ hg --repo c tip
@@ -272,6 +274,9 @@
   $ hg --version -q
   Mercurial Distributed SCM * (glob)
 
+hide outer repo
+  $ hg init
+
 Testing -h/--help:
 
   $ hg -h
--- a/tests/test-glog.t	Wed Jun 20 12:30:16 2012 -0500
+++ b/tests/test-glog.t	Wed Jun 20 23:41:21 2012 +0200
@@ -69,8 +69,6 @@
 o  (0) root
 
 
-  $ "$TESTDIR/hghave" no-outer-repo || exit 80
-
   $ commit()
   > {
   >   rev=$1
@@ -1136,8 +1134,11 @@
 Empty revision range - display nothing:
   $ hg glog -r 1..0
 
+  $ cd ..
+
+#if no-outer-repo
+
 From outer space:
-  $ cd ..
   $ hg glog -l1 repo
   @  changeset:   34:fea3ac5810e0
   |  tag:         tip
@@ -1156,6 +1157,8 @@
   |
   $ hg glog -l1 repo/missing
 
+#endif
+
 File log with revs != cset revs:
   $ hg init flog
   $ cd flog
--- a/tests/test-identify.t	Wed Jun 20 12:30:16 2012 -0500
+++ b/tests/test-identify.t	Wed Jun 20 23:41:21 2012 +0200
@@ -1,4 +1,6 @@
-  $ "$TESTDIR/hghave" no-outer-repo serve || exit 80
+  $ "$TESTDIR/hghave" serve || exit 80
+
+#if no-outer-repo
 
 no repo
 
@@ -6,6 +8,8 @@
   abort: there is no Mercurial repository here (.hg not found)
   [255]
 
+#endif
+
 create repo
 
   $ hg init test
@@ -51,8 +55,10 @@
   $ cd ..
   $ hg -R test id
   cb9a9f314b8b+ tip
+#if no-outer-repo
   $ hg id test
   cb9a9f314b8b+ tip
+#endif
 
 with remote http repo
 
@@ -111,7 +117,8 @@
   [255]
 
   $ cd ..
+#if no-outer-repo
   $ hg id test
   abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
   [255]
-
+#endif