Show More
@@ -1,222 +1,222 | |||||
1 |
|
1 | |||
2 | $ echo "[extensions]" >> $HGRCPATH |
|
2 | $ echo "[extensions]" >> $HGRCPATH | |
3 | $ echo "convert=" >> $HGRCPATH |
|
3 | $ echo "convert=" >> $HGRCPATH | |
4 | $ echo 'graphlog =' >> $HGRCPATH |
|
4 | $ echo 'graphlog =' >> $HGRCPATH | |
5 | $ glog() |
|
5 | $ glog() | |
6 | > { |
|
6 | > { | |
7 | > hg glog --template '{rev}:{node|short} "{desc|firstline}"\ |
|
7 | > hg glog --template '{rev}:{node|short} "{desc|firstline}"\ | |
8 | > files: {files}\n' "$@" |
|
8 | > files: {files}\n' "$@" | |
9 | > } |
|
9 | > } | |
10 | $ hg init repo1 |
|
10 | $ hg init repo1 | |
11 | $ cd repo1 |
|
11 | $ cd repo1 | |
12 | $ echo a > a |
|
12 | $ echo a > a | |
13 | $ hg ci -Am adda |
|
13 | $ hg ci -Am adda | |
14 | adding a |
|
14 | adding a | |
15 | $ echo b > b |
|
15 | $ echo b > b | |
16 | $ echo a >> a |
|
16 | $ echo a >> a | |
17 | $ hg ci -Am addb |
|
17 | $ hg ci -Am addb | |
18 | adding b |
|
18 | adding b | |
19 | $ PARENTID1=`hg id --debug -i` |
|
19 | $ PARENTID1=`hg id --debug -i` | |
20 | $ echo c > c |
|
20 | $ echo c > c | |
21 | $ hg ci -Am addc |
|
21 | $ hg ci -Am addc | |
22 | adding c |
|
22 | adding c | |
23 | $ PARENTID2=`hg id --debug -i` |
|
23 | $ PARENTID2=`hg id --debug -i` | |
24 | $ cd .. |
|
24 | $ cd .. | |
25 | $ glog -R repo1 |
|
25 | $ glog -R repo1 | |
26 | @ 2:e55c719b85b6 "addc" files: c |
|
26 | @ 2:e55c719b85b6 "addc" files: c | |
27 | | |
|
27 | | | |
28 | o 1:6d4c2037ddc2 "addb" files: a b |
|
28 | o 1:6d4c2037ddc2 "addb" files: a b | |
29 | | |
|
29 | | | |
30 | o 0:07f494440405 "adda" files: a |
|
30 | o 0:07f494440405 "adda" files: a | |
31 |
|
31 | |||
32 |
|
32 | |||
33 | $ hg init repo2 |
|
33 | $ hg init repo2 | |
34 | $ cd repo2 |
|
34 | $ cd repo2 | |
35 | $ echo b > a |
|
35 | $ echo b > a | |
36 | $ echo d > d |
|
36 | $ echo d > d | |
37 | $ hg ci -Am addaandd |
|
37 | $ hg ci -Am addaandd | |
38 | adding a |
|
38 | adding a | |
39 | adding d |
|
39 | adding d | |
40 | $ CHILDID1=`hg id --debug -i` |
|
40 | $ CHILDID1=`hg id --debug -i` | |
41 | $ echo d >> d |
|
41 | $ echo d >> d | |
42 | $ hg ci -Am changed |
|
42 | $ hg ci -Am changed | |
43 | $ CHILDID2=`hg id --debug -i` |
|
43 | $ CHILDID2=`hg id --debug -i` | |
44 | $ echo e > e |
|
44 | $ echo e > e | |
45 | $ hg ci -Am adde |
|
45 | $ hg ci -Am adde | |
46 | adding e |
|
46 | adding e | |
47 | $ cd .. |
|
47 | $ cd .. | |
48 | $ glog -R repo2 |
|
48 | $ glog -R repo2 | |
49 | @ 2:a39b65753b0a "adde" files: e |
|
49 | @ 2:a39b65753b0a "adde" files: e | |
50 | | |
|
50 | | | |
51 | o 1:e4ea00df9189 "changed" files: d |
|
51 | o 1:e4ea00df9189 "changed" files: d | |
52 | | |
|
52 | | | |
53 | o 0:527cdedf31fb "addaandd" files: a d |
|
53 | o 0:527cdedf31fb "addaandd" files: a d | |
54 |
|
54 | |||
55 |
|
55 | |||
56 | test invalid splicemap |
|
56 | test invalid splicemap | |
57 |
|
57 | |||
58 | $ cat > splicemap <<EOF |
|
58 | $ cat > splicemap <<EOF | |
59 | > $CHILDID2 |
|
59 | > $CHILDID2 | |
60 | > EOF |
|
60 | > EOF | |
61 | $ hg convert --splicemap splicemap repo2 repo1 |
|
61 | $ hg convert --splicemap splicemap repo2 repo1 | |
62 | abort: syntax error in splicemap(1): child parent1[,parent2] expected |
|
62 | abort: syntax error in splicemap(1): child parent1[,parent2] expected | |
63 | [255] |
|
63 | [255] | |
64 |
|
64 | |||
65 | splice repo2 on repo1 |
|
65 | splice repo2 on repo1 | |
66 |
|
66 | |||
67 | $ cat > splicemap <<EOF |
|
67 | $ cat > splicemap <<EOF | |
68 | > $CHILDID1 $PARENTID1 |
|
68 | > $CHILDID1 $PARENTID1 | |
69 | > $CHILDID2 $PARENTID2,$CHILDID1 |
|
69 | > $CHILDID2 $PARENTID2,$CHILDID1 | |
70 | > |
|
70 | > | |
71 | > EOF |
|
71 | > EOF | |
72 | $ cat splicemap |
|
72 | $ cat splicemap | |
73 | 527cdedf31fbd5ea708aa14eeecf53d4676f38db 6d4c2037ddc2cb2627ac3a244ecce35283268f8e |
|
73 | 527cdedf31fbd5ea708aa14eeecf53d4676f38db 6d4c2037ddc2cb2627ac3a244ecce35283268f8e | |
74 | e4ea00df91897da3079a10fab658c1eddba6617b e55c719b85b60e5102fac26110ba626e7cb6b7dc,527cdedf31fbd5ea708aa14eeecf53d4676f38db |
|
74 | e4ea00df91897da3079a10fab658c1eddba6617b e55c719b85b60e5102fac26110ba626e7cb6b7dc,527cdedf31fbd5ea708aa14eeecf53d4676f38db | |
75 |
|
75 | |||
76 | $ hg clone repo1 target1 |
|
76 | $ hg clone repo1 target1 | |
77 | updating to branch default |
|
77 | updating to branch default | |
78 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
79 | $ hg convert --splicemap splicemap repo2 target1 |
|
79 | $ hg convert --splicemap splicemap repo2 target1 | |
80 | scanning source... |
|
80 | scanning source... | |
81 | sorting... |
|
81 | sorting... | |
82 | converting... |
|
82 | converting... | |
83 | 2 addaandd |
|
83 | 2 addaandd | |
84 | spliced in ['6d4c2037ddc2cb2627ac3a244ecce35283268f8e'] as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db |
|
84 | spliced in ['6d4c2037ddc2cb2627ac3a244ecce35283268f8e'] as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db | |
85 | 1 changed |
|
85 | 1 changed | |
86 | spliced in ['e55c719b85b60e5102fac26110ba626e7cb6b7dc', '527cdedf31fbd5ea708aa14eeecf53d4676f38db'] as parents of e4ea00df91897da3079a10fab658c1eddba6617b |
|
86 | spliced in ['e55c719b85b60e5102fac26110ba626e7cb6b7dc', '527cdedf31fbd5ea708aa14eeecf53d4676f38db'] as parents of e4ea00df91897da3079a10fab658c1eddba6617b | |
87 | 0 adde |
|
87 | 0 adde | |
88 | $ glog -R target1 |
|
88 | $ glog -R target1 | |
89 | o 5:16bc847b02aa "adde" files: e |
|
89 | o 5:16bc847b02aa "adde" files: e | |
90 | | |
|
90 | | | |
91 | o 4:e30e4fee3418 "changed" files: d |
|
91 | o 4:e30e4fee3418 "changed" files: d | |
92 | |\ |
|
92 | |\ | |
93 | | o 3:e673348c3a3c "addaandd" files: a d |
|
93 | | o 3:e673348c3a3c "addaandd" files: a d | |
94 | | | |
|
94 | | | | |
95 | @ | 2:e55c719b85b6 "addc" files: c |
|
95 | @ | 2:e55c719b85b6 "addc" files: c | |
96 | |/ |
|
96 | |/ | |
97 | o 1:6d4c2037ddc2 "addb" files: a b |
|
97 | o 1:6d4c2037ddc2 "addb" files: a b | |
98 | | |
|
98 | | | |
99 | o 0:07f494440405 "adda" files: a |
|
99 | o 0:07f494440405 "adda" files: a | |
100 |
|
100 | |||
101 |
|
101 | |||
102 |
|
102 | |||
103 |
|
103 | |||
104 | Test splicemap and conversion order |
|
104 | Test splicemap and conversion order | |
105 |
|
105 | |||
106 | $ hg init ordered |
|
106 | $ hg init ordered | |
107 | $ cd ordered |
|
107 | $ cd ordered | |
108 | $ echo a > a |
|
108 | $ echo a > a | |
109 | $ hg ci -Am adda |
|
109 | $ hg ci -Am adda | |
110 | adding a |
|
110 | adding a | |
111 | $ hg branch branch |
|
111 | $ hg branch branch | |
112 | marked working directory as branch branch |
|
112 | marked working directory as branch branch | |
113 | (branches are permanent and global, did you want a bookmark?) |
|
113 | (branches are permanent and global, did you want a bookmark?) | |
114 | $ echo a >> a |
|
114 | $ echo a >> a | |
115 | $ hg ci -Am changea |
|
115 | $ hg ci -Am changea | |
116 | $ echo a >> a |
|
116 | $ echo a >> a | |
117 | $ hg ci -Am changeaagain |
|
117 | $ hg ci -Am changeaagain | |
118 | $ hg up 0 |
|
118 | $ hg up 0 | |
119 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
119 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
120 | $ echo b > b |
|
120 | $ echo b > b | |
121 | $ hg ci -Am addb |
|
121 | $ hg ci -Am addb | |
122 | adding b |
|
122 | adding b | |
123 |
|
123 | |||
124 | We want 2 to depend on 1 and 3. Since 3 is always converted after 2, |
|
124 | We want 2 to depend on 1 and 3. Since 3 is always converted after 2, | |
125 | the bug should be exhibited with all conversion orders. |
|
125 | the bug should be exhibited with all conversion orders. | |
126 |
|
126 | |||
127 | $ cat > ../splicemap <<EOF |
|
127 | $ cat > ../splicemap <<EOF | |
128 |
> |
|
128 | > `(hg id -r 2 -i --debug)` `(hg id -r 1 -i --debug)`, `(hg id -r 3 -i --debug)` | |
129 | > EOF |
|
129 | > EOF | |
130 | $ cd .. |
|
130 | $ cd .. | |
131 | $ cat splicemap |
|
131 | $ cat splicemap | |
132 | 7c364e7fa7d70ae525610c016317ed717b519d97 717d54d67e6c31fd75ffef2ff3042bdd98418437, 102a90ea7b4a3361e4082ed620918c261189a36a |
|
132 | 7c364e7fa7d70ae525610c016317ed717b519d97 717d54d67e6c31fd75ffef2ff3042bdd98418437, 102a90ea7b4a3361e4082ed620918c261189a36a | |
133 |
|
133 | |||
134 | Test regular conversion |
|
134 | Test regular conversion | |
135 |
|
135 | |||
136 | $ hg convert --splicemap splicemap ordered ordered-hg1 |
|
136 | $ hg convert --splicemap splicemap ordered ordered-hg1 | |
137 | initializing destination ordered-hg1 repository |
|
137 | initializing destination ordered-hg1 repository | |
138 | scanning source... |
|
138 | scanning source... | |
139 | sorting... |
|
139 | sorting... | |
140 | converting... |
|
140 | converting... | |
141 | 3 adda |
|
141 | 3 adda | |
142 | 2 changea |
|
142 | 2 changea | |
143 | 1 addb |
|
143 | 1 addb | |
144 | 0 changeaagain |
|
144 | 0 changeaagain | |
145 | spliced in ['717d54d67e6c31fd75ffef2ff3042bdd98418437', '102a90ea7b4a3361e4082ed620918c261189a36a'] as parents of 7c364e7fa7d70ae525610c016317ed717b519d97 |
|
145 | spliced in ['717d54d67e6c31fd75ffef2ff3042bdd98418437', '102a90ea7b4a3361e4082ed620918c261189a36a'] as parents of 7c364e7fa7d70ae525610c016317ed717b519d97 | |
146 | $ glog -R ordered-hg1 |
|
146 | $ glog -R ordered-hg1 | |
147 | o 3:4cb04b9afbf2 "changeaagain" files: a |
|
147 | o 3:4cb04b9afbf2 "changeaagain" files: a | |
148 | |\ |
|
148 | |\ | |
149 | | o 2:102a90ea7b4a "addb" files: b |
|
149 | | o 2:102a90ea7b4a "addb" files: b | |
150 | | | |
|
150 | | | | |
151 | o | 1:717d54d67e6c "changea" files: a |
|
151 | o | 1:717d54d67e6c "changea" files: a | |
152 | |/ |
|
152 | |/ | |
153 | o 0:07f494440405 "adda" files: a |
|
153 | o 0:07f494440405 "adda" files: a | |
154 |
|
154 | |||
155 |
|
155 | |||
156 | Test conversion with parent revisions already in dest, using source |
|
156 | Test conversion with parent revisions already in dest, using source | |
157 | and destination identifiers. Test unknown splicemap target. |
|
157 | and destination identifiers. Test unknown splicemap target. | |
158 |
|
158 | |||
159 | $ hg convert -r1 ordered ordered-hg2 |
|
159 | $ hg convert -r1 ordered ordered-hg2 | |
160 | initializing destination ordered-hg2 repository |
|
160 | initializing destination ordered-hg2 repository | |
161 | scanning source... |
|
161 | scanning source... | |
162 | sorting... |
|
162 | sorting... | |
163 | converting... |
|
163 | converting... | |
164 | 1 adda |
|
164 | 1 adda | |
165 | 0 changea |
|
165 | 0 changea | |
166 | $ hg convert -r3 ordered ordered-hg2 |
|
166 | $ hg convert -r3 ordered ordered-hg2 | |
167 | scanning source... |
|
167 | scanning source... | |
168 | sorting... |
|
168 | sorting... | |
169 | converting... |
|
169 | converting... | |
170 | 0 addb |
|
170 | 0 addb | |
171 | $ cat > splicemap <<EOF |
|
171 | $ cat > splicemap <<EOF | |
172 |
> |
|
172 | > `(hg -R ordered id -r 2 -i --debug)` \ | |
173 |
> |
|
173 | > `(hg -R ordered-hg2 id -r 1 -i --debug)`,\ | |
174 |
> |
|
174 | > `(hg -R ordered-hg2 id -r 2 -i --debug)` | |
175 | > deadbeef102a90ea7b4a3361e4082ed620918c26 deadbeef102a90ea7b4a3361e4082ed620918c27 |
|
175 | > deadbeef102a90ea7b4a3361e4082ed620918c26 deadbeef102a90ea7b4a3361e4082ed620918c27 | |
176 | > EOF |
|
176 | > EOF | |
177 | $ hg convert --splicemap splicemap ordered ordered-hg2 |
|
177 | $ hg convert --splicemap splicemap ordered ordered-hg2 | |
178 | scanning source... |
|
178 | scanning source... | |
179 | splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring |
|
179 | splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring | |
180 | sorting... |
|
180 | sorting... | |
181 | converting... |
|
181 | converting... | |
182 | 0 changeaagain |
|
182 | 0 changeaagain | |
183 | spliced in ['717d54d67e6c31fd75ffef2ff3042bdd98418437', '102a90ea7b4a3361e4082ed620918c261189a36a'] as parents of 7c364e7fa7d70ae525610c016317ed717b519d97 |
|
183 | spliced in ['717d54d67e6c31fd75ffef2ff3042bdd98418437', '102a90ea7b4a3361e4082ed620918c261189a36a'] as parents of 7c364e7fa7d70ae525610c016317ed717b519d97 | |
184 | $ glog -R ordered-hg2 |
|
184 | $ glog -R ordered-hg2 | |
185 | o 3:4cb04b9afbf2 "changeaagain" files: a |
|
185 | o 3:4cb04b9afbf2 "changeaagain" files: a | |
186 | |\ |
|
186 | |\ | |
187 | | o 2:102a90ea7b4a "addb" files: b |
|
187 | | o 2:102a90ea7b4a "addb" files: b | |
188 | | | |
|
188 | | | | |
189 | o | 1:717d54d67e6c "changea" files: a |
|
189 | o | 1:717d54d67e6c "changea" files: a | |
190 | |/ |
|
190 | |/ | |
191 | o 0:07f494440405 "adda" files: a |
|
191 | o 0:07f494440405 "adda" files: a | |
192 |
|
192 | |||
193 |
|
193 | |||
194 | Test empty conversion |
|
194 | Test empty conversion | |
195 |
|
195 | |||
196 | $ hg convert --splicemap splicemap ordered ordered-hg2 |
|
196 | $ hg convert --splicemap splicemap ordered ordered-hg2 | |
197 | scanning source... |
|
197 | scanning source... | |
198 | splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring |
|
198 | splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring | |
199 | sorting... |
|
199 | sorting... | |
200 | converting... |
|
200 | converting... | |
201 |
|
201 | |||
202 | Test clonebranches |
|
202 | Test clonebranches | |
203 |
|
203 | |||
204 | $ hg --config convert.hg.clonebranches=true convert \ |
|
204 | $ hg --config convert.hg.clonebranches=true convert \ | |
205 | > --splicemap splicemap ordered ordered-hg3 |
|
205 | > --splicemap splicemap ordered ordered-hg3 | |
206 | initializing destination ordered-hg3 repository |
|
206 | initializing destination ordered-hg3 repository | |
207 | scanning source... |
|
207 | scanning source... | |
208 | abort: revision 717d54d67e6c31fd75ffef2ff3042bdd98418437 not found in destination repository (lookups with clonebranches=true are not implemented) |
|
208 | abort: revision 717d54d67e6c31fd75ffef2ff3042bdd98418437 not found in destination repository (lookups with clonebranches=true are not implemented) | |
209 | [255] |
|
209 | [255] | |
210 |
|
210 | |||
211 | Test invalid dependency |
|
211 | Test invalid dependency | |
212 |
|
212 | |||
213 | $ cat > splicemap <<EOF |
|
213 | $ cat > splicemap <<EOF | |
214 |
> |
|
214 | > `(hg -R ordered id -r 2 -i --debug)` \ | |
215 | > deadbeef102a90ea7b4a3361e4082ed620918c26,\ |
|
215 | > deadbeef102a90ea7b4a3361e4082ed620918c26,\ | |
216 |
> |
|
216 | > `(hg -R ordered-hg2 id -r 2 -i --debug)` | |
217 | > EOF |
|
217 | > EOF | |
218 | $ hg convert --splicemap splicemap ordered ordered-hg4 |
|
218 | $ hg convert --splicemap splicemap ordered ordered-hg4 | |
219 | initializing destination ordered-hg4 repository |
|
219 | initializing destination ordered-hg4 repository | |
220 | scanning source... |
|
220 | scanning source... | |
221 | abort: unknown splice map parent: deadbeef102a90ea7b4a3361e4082ed620918c26 |
|
221 | abort: unknown splice map parent: deadbeef102a90ea7b4a3361e4082ed620918c26 | |
222 | [255] |
|
222 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now