##// END OF EJS Templates
tests: unify test-convert-hg-startrev.
Dan Villiom Podlaski Christiansen -
r12148:0a0592f8 default
parent child Browse files
Show More
@@ -1,61 +1,152 b''
1 #!/bin/sh
1
2 $ cat > $HGRCPATH <<EOF
3 > [extensions]
4 > graphlog =
5 > convert =
6 > EOF
7
8 $ glog()
9 > {
10 > hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
11 > }
12
13 $ hg init source
14 $ cd source
2 15
3 echo '[extensions]' >> $HGRCPATH
4 echo 'graphlog =' >> $HGRCPATH
5 echo 'convert =' >> $HGRCPATH
16 $ echo a > a
17 $ echo b > b
18 $ hg ci -d '0 0' -qAm '0: add a b'
19 $ echo c > c
20 $ hg ci -d '1 0' -qAm '1: add c'
21 $ hg copy a e
22 $ echo b >> b
23 $ hg ci -d '2 0' -qAm '2: copy e from a, change b'
24 $ hg up -C 0
25 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
26 $ echo a >> a
27 $ hg ci -d '3 0' -qAm '3: change a'
28 $ hg merge
29 merging a and e to e
30 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
31 (branch merge, don't forget to commit)
32 $ hg copy b d
33 $ hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
34 $ echo a >> a
35 $ hg ci -d '5 0' -qAm '5: change a'
36 $ cd ..
6 37
7 glog()
8 {
9 hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
10 }
38 Convert from null revision
39
40 $ hg convert --config convert.hg.startrev=null source empty
41 initializing destination empty repository
42 scanning source...
43 sorting...
44 converting...
45
46 $ glog empty
47
48 Convert from zero revision
11 49
12 hg init source
13 cd source
50 $ hg convert --config convert.hg.startrev=0 source full
51 initializing destination full repository
52 scanning source...
53 sorting...
54 converting...
55 5 0: add a b
56 4 1: add c
57 3 2: copy e from a, change b
58 2 3: change a
59 1 4: merge 2 and 3, copy d from b
60 0 5: change a
61
62 $ glog full
63 o 5 "5: change a" files: a
64 |
65 o 4 "4: merge 2 and 3, copy d from b" files: d e
66 |\
67 | o 3 "3: change a" files: a
68 | |
69 o | 2 "2: copy e from a, change b" files: b e
70 | |
71 o | 1 "1: add c" files: c
72 |/
73 o 0 "0: add a b" files: a b
74
75 Convert from merge parent
14 76
15 echo a > a
16 echo b > b
17 hg ci -d '0 0' -qAm '0: add a b'
18 echo c > c
19 hg ci -d '1 0' -qAm '1: add c'
20 hg copy a e
21 echo b >> b
22 hg ci -d '2 0' -qAm '2: copy e from a, change b'
23 hg up -C 0
24 echo a >> a
25 hg ci -d '3 0' -qAm '3: change a'
26 hg merge
27 hg copy b d
28 hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
29 echo a >> a
30 hg ci -d '5 0' -qAm '5: change a'
31 cd ..
77 $ hg convert --config convert.hg.startrev=1 source conv1
78 initializing destination conv1 repository
79 scanning source...
80 sorting...
81 converting...
82 3 1: add c
83 2 2: copy e from a, change b
84 1 4: merge 2 and 3, copy d from b
85 0 5: change a
32 86
33 echo % convert from null revision
34 hg convert --config convert.hg.startrev=null source empty
35 glog empty
87 $ glog conv1
88 o 3 "5: change a" files: a
89 |
90 o 2 "4: merge 2 and 3, copy d from b" files: a d e
91 |
92 o 1 "2: copy e from a, change b" files: b e
93 |
94 o 0 "1: add c" files: a b c
95
96 $ cd conv1
97
98 Check copy preservation
99
100 $ hg log --follow --copies e
101 changeset: 2:d67b1d48a835
102 user: test
103 date: Thu Jan 01 00:00:04 1970 +0000
104 summary: 4: merge 2 and 3, copy d from b
105
106 changeset: 1:462c431cf47d
107 user: test
108 date: Thu Jan 01 00:00:02 1970 +0000
109 summary: 2: copy e from a, change b
110
111 Check copy removal on missing parent
36 112
37 echo % convert from zero revision
38 hg convert --config convert.hg.startrev=0 source full
39 glog full
113 $ hg log --follow --copies d
114 changeset: 2:d67b1d48a835
115 user: test
116 date: Thu Jan 01 00:00:04 1970 +0000
117 summary: 4: merge 2 and 3, copy d from b
118
119 $ hg cat -r tip a b
120 a
121 a
122 a
123 b
124 b
125 $ hg -q verify
126 $ cd ..
127
128 Convert from merge
40 129
41 echo % convert from merge parent
42 hg convert --config convert.hg.startrev=1 source conv1
43 glog conv1
44 cd conv1
45 echo % check copy preservation
46 hg log --follow --copies e
47 echo % check copy removal on missing parent
48 hg log --follow --copies d
49 hg cat -r tip a b
50 hg -q verify
51 cd ..
130 $ hg convert --config convert.hg.startrev=4 source conv4
131 initializing destination conv4 repository
132 scanning source...
133 sorting...
134 converting...
135 1 4: merge 2 and 3, copy d from b
136 0 5: change a
137 $ glog conv4
138 o 1 "5: change a" files: a
139 |
140 o 0 "4: merge 2 and 3, copy d from b" files: a b c d e
52 141
53 echo % convert from merge
54 hg convert --config convert.hg.startrev=4 source conv4
55 glog conv4
56 cd conv4
57 hg up -C
58 hg cat -r tip a b
59 hg -q verify
60 cd ..
61
142 $ cd conv4
143 $ hg up -C
144 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 $ hg cat -r tip a b
146 a
147 a
148 a
149 b
150 b
151 $ hg -q verify
152 $ cd ..
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now