##// 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
16 $ echo a > a
4 echo 'graphlog =' >> $HGRCPATH
17 $ echo b > b
5 echo 'convert =' >> $HGRCPATH
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()
38 Convert from null revision
8 {
39
9 hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
40 $ hg convert --config convert.hg.startrev=null source empty
10 }
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
50 $ hg convert --config convert.hg.startrev=0 source full
13 cd source
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
77 $ hg convert --config convert.hg.startrev=1 source conv1
16 echo b > b
78 initializing destination conv1 repository
17 hg ci -d '0 0' -qAm '0: add a b'
79 scanning source...
18 echo c > c
80 sorting...
19 hg ci -d '1 0' -qAm '1: add c'
81 converting...
20 hg copy a e
82 3 1: add c
21 echo b >> b
83 2 2: copy e from a, change b
22 hg ci -d '2 0' -qAm '2: copy e from a, change b'
84 1 4: merge 2 and 3, copy d from b
23 hg up -C 0
85 0 5: change a
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 ..
32
86
33 echo % convert from null revision
87 $ glog conv1
34 hg convert --config convert.hg.startrev=null source empty
88 o 3 "5: change a" files: a
35 glog empty
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
113 $ hg log --follow --copies d
38 hg convert --config convert.hg.startrev=0 source full
114 changeset: 2:d67b1d48a835
39 glog full
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
130 $ hg convert --config convert.hg.startrev=4 source conv4
42 hg convert --config convert.hg.startrev=1 source conv1
131 initializing destination conv4 repository
43 glog conv1
132 scanning source...
44 cd conv1
133 sorting...
45 echo % check copy preservation
134 converting...
46 hg log --follow --copies e
135 1 4: merge 2 and 3, copy d from b
47 echo % check copy removal on missing parent
136 0 5: change a
48 hg log --follow --copies d
137 $ glog conv4
49 hg cat -r tip a b
138 o 1 "5: change a" files: a
50 hg -q verify
139 |
51 cd ..
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
142 $ cd conv4
54 hg convert --config convert.hg.startrev=4 source conv4
143 $ hg up -C
55 glog conv4
144 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 cd conv4
145 $ hg cat -r tip a b
57 hg up -C
146 a
58 hg cat -r tip a b
147 a
59 hg -q verify
148 a
60 cd ..
149 b
61
150 b
151 $ hg -q verify
152 $ cd ..
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now