changeset 16912:6ef3107c661e

tests: cleanup of tests that got lost in their own nested directories Some tests ended up in a directory several directories deeper than $TESTTMP, usually because some 'cd ..' had been forgotten between different test cases. Add 'cd ..' where they are missing so the tests get back where they started.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 11 Jun 2012 01:38:32 +0200
parents 39d38f16a3f7
children f2719b387380
files tests/test-addremove.t tests/test-alias.t tests/test-backout.t tests/test-diff-unified.t tests/test-grep.t tests/test-import.t tests/test-inherit-mode.t tests/test-locate.t tests/test-log.t tests/test-mq.t tests/test-rebase-mq.t tests/test-subrepo.t tests/test-transplant.t tests/test-verify.t
diffstat 14 files changed, 79 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-addremove.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-addremove.t	Mon Jun 11 01:38:32 2012 +0200
@@ -18,8 +18,8 @@
   dir/bar_2
   foo_2
   committed changeset 1:e65414bf35c5
+  $ cd ../..
 
-  $ cd ..
   $ hg init sim
   $ cd sim
   $ echo a > a
@@ -45,3 +45,4 @@
   adding d
   recording removal of a as rename to b (100% similar)
   $ hg commit -mb
+  $ cd ..
--- a/tests/test-alias.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-alias.t	Mon Jun 11 01:38:32 2012 +0200
@@ -424,3 +424,5 @@
 This shouldn't:
 
   $ hg --config alias.log='id' history
+
+  $ cd ../..
--- a/tests/test-backout.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-backout.t	Mon Jun 11 01:38:32 2012 +0200
@@ -117,6 +117,8 @@
   line 2
   line 3
 
+  $ cd ..
+
 backout should not back out subsequent changesets
 
   $ hg init onecs
@@ -288,3 +290,5 @@
   $ hg st -A
   C default
   C file1
+
+  $ cd ..
--- a/tests/test-diff-unified.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-diff-unified.t	Mon Jun 11 01:38:32 2012 +0200
@@ -89,6 +89,9 @@
   abort: diff context lines count must be an integer, not 'foo'
   [255]
 
+  $ cd ..
+
+
 0 lines of context hunk header matches gnu diff hunk header
 
   $ hg init diffzero
@@ -191,3 +194,5 @@
   @@ -1,1 +1,1 @@
   -b
   +a
+
+  $ cd ..
--- a/tests/test-grep.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-grep.t	Mon Jun 11 01:38:32 2012 +0200
@@ -163,6 +163,8 @@
   color:3:-:red
   color:1:+:red
 
+  $ cd ..
+
   $ hg init a
   $ cd a
   $ cp "$TESTDIR/binfile.bin" .
@@ -170,3 +172,5 @@
   $ hg ci -m 'add binfile.bin'
   $ hg grep "MaCam" --all
   binfile.bin:0:+: Binary file matches
+
+  $ cd ..
--- a/tests/test-import.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-import.t	Mon Jun 11 01:38:32 2012 +0200
@@ -754,6 +754,7 @@
   $ cat foo
   a
 
+  $ cd ..
 
 Issue1859: first line mistaken for email headers
 
@@ -788,7 +789,7 @@
   $ cd ..
 
 
---- in commit message
+in commit message
 
   $ hg init commitconfusion
   $ cd commitconfusion
@@ -1031,6 +1032,8 @@
   c3
   c4
 
+  $ cd ..
+
 no segfault while importing a unified diff which start line is zero but chunk
 size is non-zero
 
@@ -1149,3 +1152,4 @@
   4
   line
 
+  $ cd ..
--- a/tests/test-inherit-mode.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-inherit-mode.t	Mon Jun 11 01:38:32 2012 +0200
@@ -146,4 +146,7 @@
   $ dirmode=`python ../mode.py .hg/store/data/dir`
   $ if [ "$storemode" != "$dirmode" ]; then
   >  echo "$storemode != $dirmode"
-  $ fi
+  > fi
+  $ cd ..
+
+  $ cd .. # g-s dir
--- a/tests/test-locate.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-locate.t	Mon Jun 11 01:38:32 2012 +0200
@@ -1,5 +1,5 @@
-  $ hg init t
-  $ cd t
+  $ hg init repo
+  $ cd repo
   $ echo 0 > a
   $ echo 0 > b
   $ echo 0 > t.h
@@ -118,3 +118,4 @@
   ../t.h (glob)
   ../t/e.h (glob)
 
+  $ cd ../..
--- a/tests/test-log.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-log.t	Mon Jun 11 01:38:32 2012 +0200
@@ -331,12 +331,12 @@
   a
   
   
-
+  $ cd ..
 
 log --follow tests
 
-  $ hg init ../follow
-  $ cd ../follow
+  $ hg init follow
+  $ cd follow
 
   $ echo base > base
   $ hg ci -Ambase -d '1 0'
@@ -614,6 +614,9 @@
 
   $ cd ..
 
+
+User
+
   $ hg init usertest
   $ cd usertest
 
@@ -898,12 +901,11 @@
   +a
   
 
+  $ cd ../..
 
-  $ cd ..
   $ hg init follow2
   $ cd follow2
 
-
 # Build the following history:
 # tip - o - x - o - x - x
 #    \                 /
@@ -1077,6 +1079,7 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add foo, related
   
+  $ cd ..
 
 Issue2383: hg log showing _less_ differences than hg diff
 
@@ -1153,7 +1156,8 @@
 
 'hg log -r rev fn' when last(filelog(fn)) != rev
 
-  $ hg init simplelog; cd simplelog
+  $ hg init simplelog
+  $ cd simplelog
   $ echo f > a
   $ hg ci -Am'a' -d '0 0'
   adding a
--- a/tests/test-mq.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-mq.t	Mon Jun 11 01:38:32 2012 +0200
@@ -795,6 +795,7 @@
   $ hg strip -f tip
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
+  $ cd ..
 
 
 cd b; hg qrefresh
@@ -905,11 +906,15 @@
   no patches applied
   [1]
 
+  $ cd ..
+
+
+git patches
+
   $ cat >>$HGRCPATH <<EOF
   > [diff]
   > git = True
   > EOF
-  $ cd ..
   $ hg init git
   $ cd git
   $ hg qinit
@@ -1193,7 +1198,7 @@
   
   $ hg strip 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
+  saved backup bundle to $TESTTMP/strip/.hg/strip-backup/*-backup.hg (glob)
   $ checkundo strip
   $ hg log
   changeset:   1:20cbbe65cff7
@@ -1539,3 +1544,5 @@
   0: draft
   1: secret
   2: secret
+
+  $ cd ..
--- a/tests/test-rebase-mq.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-rebase-mq.t	Mon Jun 11 01:38:32 2012 +0200
@@ -235,6 +235,7 @@
   -mq1
   +mq2
 
+  $ cd ..
 
 Rebase with guards
 
@@ -339,3 +340,4 @@
   |
   o  0:* 'a' tags: (glob)
   
+  $ cd ..
--- a/tests/test-subrepo.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-subrepo.t	Mon Jun 11 01:38:32 2012 +0200
@@ -3,9 +3,6 @@
   $ echo "[ui]" >> $HGRCPATH
   $ echo "commitsubrepos = Yes" >> $HGRCPATH
 
-  $ rm -rf sub
-  $ mkdir sub
-  $ cd sub
   $ hg init t
   $ cd t
 
@@ -266,9 +263,9 @@
   $ cd ..
   $ hg clone t tc
   updating to branch default
-  cloning subrepo s from $TESTTMP/sub/t/s (glob)
-  cloning subrepo s/ss from $TESTTMP/sub/t/s/ss (glob)
-  cloning subrepo t from $TESTTMP/sub/t/t (glob)
+  cloning subrepo s from $TESTTMP/t/s (glob)
+  cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
+  cloning subrepo t from $TESTTMP/t/t (glob)
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd tc
   $ hg debugsub
@@ -285,14 +282,14 @@
   $ hg ci -m11
   committing subrepository t
   $ hg push
-  pushing to $TESTTMP/sub/t (glob)
-  pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
+  pushing to $TESTTMP/t (glob)
+  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/sub/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s (glob)
   searching for changes
   no changes found
-  pushing subrepo t to $TESTTMP/sub/t/t (glob)
+  pushing subrepo t to $TESTTMP/t/t (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -310,27 +307,27 @@
   $ hg ci -m12
   committing subrepository s
   $ hg push
-  pushing to $TESTTMP/sub/t (glob)
-  pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
+  pushing to $TESTTMP/t (glob)
+  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/sub/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s (glob)
   searching for changes
   abort: push creates new remote head 12a213df6fa9!
   (did you forget to merge? use push -f to force)
   [255]
   $ hg push -f
-  pushing to $TESTTMP/sub/t (glob)
-  pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
+  pushing to $TESTTMP/t (glob)
+  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/sub/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s (glob)
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
-  pushing subrepo t to $TESTTMP/sub/t/t (glob)
+  pushing subrepo t to $TESTTMP/t/t (glob)
   searching for changes
   no changes found
   searching for changes
@@ -352,7 +349,7 @@
 
   $ cd ../tc
   $ hg pull
-  pulling from $TESTTMP/sub/t (glob)
+  pulling from $TESTTMP/t (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -363,7 +360,7 @@
 should pull t
 
   $ hg up
-  pulling subrepo t from $TESTTMP/sub/t/t (glob)
+  pulling subrepo t from $TESTTMP/t/t (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -552,9 +549,9 @@
   $ cat mercurial2/main/nested_absolute/.hg/hgrc \
   >     mercurial2/main/nested_relative/.hg/hgrc
   [paths]
-  default = $TESTTMP/sub/mercurial/nested_absolute
+  default = $TESTTMP/mercurial/nested_absolute
   [paths]
-  default = $TESTTMP/sub/mercurial/nested_relative
+  default = $TESTTMP/mercurial/nested_relative
   $ rm -rf mercurial mercurial2
 
 Issue1977: multirepo push should fail if subrepo push fails
@@ -569,7 +566,7 @@
   adding .hgsub
   $ hg clone repo repo2
   updating to branch default
-  cloning subrepo s from $TESTTMP/sub/repo/s (glob)
+  cloning subrepo s from $TESTTMP/repo/s (glob)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg -q -R repo2 pull -u
   $ echo 1 > repo2/s/a
@@ -645,8 +642,8 @@
 Try to push from the other side
 
   $ hg -R issue1852a push `pwd`/issue1852c
-  pushing to $TESTTMP/sub/issue1852c
-  pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo (glob)
+  pushing to $TESTTMP/issue1852c
+  pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
   searching for changes
   no changes found
   searching for changes
@@ -694,7 +691,7 @@
   $ hg st subrepo-2/file
 
 Check hg update --clean
-  $ cd $TESTTMP/sub/t
+  $ cd $TESTTMP/t
   $ rm -r t/t.orig
   $ hg status -S --all
   C .hgsub
@@ -722,7 +719,7 @@
   ? s/c
 
 Sticky subrepositories, no changes
-  $ cd $TESTTMP/sub/t
+  $ cd $TESTTMP/t
   $ hg id
   925c17564ef8 tip
   $ hg -R s id
@@ -1017,3 +1014,4 @@
   $ hg st -S
   ? s/f19
   $ rm s/f19
+  $ cd ..
--- a/tests/test-transplant.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-transplant.t	Mon Jun 11 01:38:32 2012 +0200
@@ -441,6 +441,7 @@
   filtering * (glob)
   abort: filter corrupted changeset (no user or date)
   [255]
+  $ cd ..
 
 test with a win32ext like setup (differing EOLs)
 
@@ -499,6 +500,7 @@
   $ hg init merge1b
   $ cd merge1b
   $ hg transplant -s ../merge1a tip
+  $ cd ..
 
 test transplant with merge changeset accepts --parent
 
@@ -527,3 +529,4 @@
   $ hg transplant -s ../merge2a --parent 0 tip
   applying be9f9b39483f
   be9f9b39483f transplanted to 9959e51f94d1
+  $ cd ..
--- a/tests/test-verify.t	Mon Jun 11 01:08:39 2012 +0200
+++ b/tests/test-verify.t	Mon Jun 11 01:38:32 2012 +0200
@@ -58,6 +58,7 @@
   (first damaged changeset appears to be 0)
   [1]
 
+  $ cd ../../..
   $ cd ..
 
 test revlog corruption
@@ -99,3 +100,4 @@
   crosschecking files in changesets and manifests
   checking files
   1 files, 1 changesets, 1 total revisions
+  $ cd ..