changeset 12518:89f1210a1238

tests: unify test-convert-clonebranches
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Sep 2010 14:39:34 -0500
parents cc8f1083e8be
children 99232aa664d6
files tests/test-convert-authormap.t tests/test-convert-bzr-114.t tests/test-convert-bzr-directories.t tests/test-convert-bzr-ghosts.t tests/test-convert-bzr-merges.t tests/test-convert-bzr-treeroot.t tests/test-convert-bzr.t tests/test-convert-clonebranches tests/test-convert-clonebranches.out tests/test-convert-clonebranches.t tests/test-convert.t
diffstat 3 files changed, 84 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-convert-clonebranches	Sun Sep 26 14:37:47 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "[convert]" >> $HGRCPATH
-echo "hg.tagsbranch=0" >> $HGRCPATH
-
-hg init source
-cd source
-echo a > a
-hg ci -qAm adda
-# Add a merge with one parent in the same branch
-echo a >> a
-hg ci -qAm changea
-hg up -qC 0
-hg branch branch0
-echo b > b
-hg ci -qAm addb
-hg up -qC
-hg merge default
-hg ci -qm mergeab
-hg tag -ql mergeab
-cd ..
-
-# Miss perl... sometimes
-cat > filter.py <<EOF
-import sys, re
-
-r = re.compile(r'^(?:\d+|pulling from)')
-sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
-EOF
-
-echo % convert
-hg convert -v --config convert.hg.clonebranches=1 source dest |
-    python filter.py
-
-# Add a merge with both parents and child in different branches
-cd source
-hg branch branch1
-echo a > file1
-hg ci -qAm c1
-hg up -qC mergeab
-hg branch branch2
-echo a > file2
-hg ci -qAm c2
-hg merge branch1
-hg branch branch3
-hg ci -qAm c3
-cd ..
-
-echo % incremental conversion
-hg convert -v --config convert.hg.clonebranches=1 source dest |
-    python filter.py
-
--- a/tests/test-convert-clonebranches.out	Sun Sep 26 14:37:47 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-marked working directory as branch branch0
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% convert
-3 adda
-2 changea
-1 addb
-pulling from default into branch0
-1 changesets found
-0 mergeab
-pulling from default into branch0
-1 changesets found
-marked working directory as branch branch1
-marked working directory as branch branch2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-marked working directory as branch branch3
-% incremental conversion
-2 c1
-pulling from branch0 into branch1
-4 changesets found
-1 c2
-pulling from branch0 into branch2
-4 changesets found
-0 c3
-pulling from branch2 into branch3
-5 changesets found
-pulling from branch1 into branch3
-1 changesets found
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-clonebranches.t	Sun Sep 26 14:39:34 2010 -0500
@@ -0,0 +1,84 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "[convert]" >> $HGRCPATH
+  $ echo "hg.tagsbranch=0" >> $HGRCPATH
+  $ hg init source
+  $ cd source
+  $ echo a > a
+  $ hg ci -qAm adda
+
+Add a merge with one parent in the same branch
+
+  $ echo a >> a
+  $ hg ci -qAm changea
+  $ hg up -qC 0
+  $ hg branch branch0
+  marked working directory as branch branch0
+  $ echo b > b
+  $ hg ci -qAm addb
+  $ hg up -qC
+  $ hg merge default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -qm mergeab
+  $ hg tag -ql mergeab
+  $ cd ..
+
+Miss perl... sometimes
+
+  $ cat > filter.py <<EOF
+  > import sys, re
+  > 
+  > r = re.compile(r'^(?:\d+|pulling from)')
+  > sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
+  > EOF
+
+convert
+
+  $ hg convert -v --config convert.hg.clonebranches=1 source dest |
+  >     python filter.py
+  3 adda
+  2 changea
+  1 addb
+  pulling from default into branch0
+  1 changesets found
+  0 mergeab
+  pulling from default into branch0
+  1 changesets found
+
+Add a merge with both parents and child in different branches
+
+  $ cd source
+  $ hg branch branch1
+  marked working directory as branch branch1
+  $ echo a > file1
+  $ hg ci -qAm c1
+  $ hg up -qC mergeab
+  $ hg branch branch2
+  marked working directory as branch branch2
+  $ echo a > file2
+  $ hg ci -qAm c2
+  $ hg merge branch1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg branch branch3
+  marked working directory as branch branch3
+  $ hg ci -qAm c3
+  $ cd ..
+
+incremental conversion
+
+  $ hg convert -v --config convert.hg.clonebranches=1 source dest |
+  >     python filter.py
+  2 c1
+  pulling from branch0 into branch1
+  4 changesets found
+  1 c2
+  pulling from branch0 into branch2
+  4 changesets found
+  0 c3
+  pulling from branch2 into branch3
+  5 changesets found
+  pulling from branch1 into branch3
+  1 changesets found