comparison tests/test-convert-clonebranches.t @ 12518:89f1210a1238

tests: unify test-convert-clonebranches
author Matt Mackall <mpm@selenic.com>
date Sun, 26 Sep 2010 14:39:34 -0500
parents tests/test-convert-clonebranches@bb5ea66789e3
children 41885892796e
comparison
equal deleted inserted replaced
12517:cc8f1083e8be 12518:89f1210a1238
1
2 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "convert = " >> $HGRCPATH
4 $ echo "[convert]" >> $HGRCPATH
5 $ echo "hg.tagsbranch=0" >> $HGRCPATH
6 $ hg init source
7 $ cd source
8 $ echo a > a
9 $ hg ci -qAm adda
10
11 Add a merge with one parent in the same branch
12
13 $ echo a >> a
14 $ hg ci -qAm changea
15 $ hg up -qC 0
16 $ hg branch branch0
17 marked working directory as branch branch0
18 $ echo b > b
19 $ hg ci -qAm addb
20 $ hg up -qC
21 $ hg merge default
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 (branch merge, don't forget to commit)
24 $ hg ci -qm mergeab
25 $ hg tag -ql mergeab
26 $ cd ..
27
28 Miss perl... sometimes
29
30 $ cat > filter.py <<EOF
31 > import sys, re
32 >
33 > r = re.compile(r'^(?:\d+|pulling from)')
34 > sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
35 > EOF
36
37 convert
38
39 $ hg convert -v --config convert.hg.clonebranches=1 source dest |
40 > python filter.py
41 3 adda
42 2 changea
43 1 addb
44 pulling from default into branch0
45 1 changesets found
46 0 mergeab
47 pulling from default into branch0
48 1 changesets found
49
50 Add a merge with both parents and child in different branches
51
52 $ cd source
53 $ hg branch branch1
54 marked working directory as branch branch1
55 $ echo a > file1
56 $ hg ci -qAm c1
57 $ hg up -qC mergeab
58 $ hg branch branch2
59 marked working directory as branch branch2
60 $ echo a > file2
61 $ hg ci -qAm c2
62 $ hg merge branch1
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 (branch merge, don't forget to commit)
65 $ hg branch branch3
66 marked working directory as branch branch3
67 $ hg ci -qAm c3
68 $ cd ..
69
70 incremental conversion
71
72 $ hg convert -v --config convert.hg.clonebranches=1 source dest |
73 > python filter.py
74 2 c1
75 pulling from branch0 into branch1
76 4 changesets found
77 1 c2
78 pulling from branch0 into branch2
79 4 changesets found
80 0 c3
81 pulling from branch2 into branch3
82 5 changesets found
83 pulling from branch1 into branch3
84 1 changesets found