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