Show More
@@ -1,363 +1,364 b'' | |||
|
1 | 1 | $ cat <<EOF >> $HGRCPATH |
|
2 | 2 | > [extensions] |
|
3 | 3 | > transplant= |
|
4 | 4 | > EOF |
|
5 | 5 | |
|
6 | 6 | $ hg init t |
|
7 | 7 | $ cd t |
|
8 | 8 | $ echo r1 > r1 |
|
9 | 9 | $ hg ci -Amr1 -d'0 0' |
|
10 | 10 | adding r1 |
|
11 | 11 | $ echo r2 > r2 |
|
12 | 12 | $ hg ci -Amr2 -d'1 0' |
|
13 | 13 | adding r2 |
|
14 | 14 | $ hg up 0 |
|
15 | 15 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
16 | 16 | |
|
17 | 17 | $ echo b1 > b1 |
|
18 | 18 | $ hg ci -Amb1 -d '0 0' |
|
19 | 19 | adding b1 |
|
20 | 20 | created new head |
|
21 | 21 | $ echo b2 > b2 |
|
22 | 22 | $ hg ci -Amb2 -d '1 0' |
|
23 | 23 | adding b2 |
|
24 | 24 | $ echo b3 > b3 |
|
25 | 25 | $ hg ci -Amb3 -d '2 0' |
|
26 | 26 | adding b3 |
|
27 | 27 | |
|
28 | 28 | $ hg log --template '{rev} {parents} {desc}\n' |
|
29 | 29 | 4 b3 |
|
30 | 30 | 3 b2 |
|
31 | 31 | 2 0:17ab29e464c6 b1 |
|
32 | 32 | 1 r2 |
|
33 | 33 | 0 r1 |
|
34 | 34 | |
|
35 | 35 | $ hg clone . ../rebase |
|
36 | 36 | updating to branch default |
|
37 | 37 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
38 | 38 | $ cd ../rebase |
|
39 | 39 | |
|
40 | 40 | $ hg up -C 1 |
|
41 | 41 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
42 | 42 | |
|
43 | 43 | rebase b onto r1 |
|
44 | 44 | |
|
45 | 45 | $ hg transplant -a -b tip |
|
46 | 46 | applying 37a1297eb21b |
|
47 | 47 | 37a1297eb21b transplanted to e234d668f844 |
|
48 | 48 | applying 722f4667af76 |
|
49 | 49 | 722f4667af76 transplanted to 539f377d78df |
|
50 | 50 | applying a53251cdf717 |
|
51 | 51 | a53251cdf717 transplanted to ffd6818a3975 |
|
52 | 52 | $ hg log --template '{rev} {parents} {desc}\n' |
|
53 | 53 | 7 b3 |
|
54 | 54 | 6 b2 |
|
55 | 55 | 5 1:d11e3596cc1a b1 |
|
56 | 56 | 4 b3 |
|
57 | 57 | 3 b2 |
|
58 | 58 | 2 0:17ab29e464c6 b1 |
|
59 | 59 | 1 r2 |
|
60 | 60 | 0 r1 |
|
61 | 61 | |
|
62 | 62 | test transplanted revset |
|
63 | 63 | |
|
64 | 64 | $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n' |
|
65 | 65 | 5 1:d11e3596cc1a b1 |
|
66 | 66 | 6 b2 |
|
67 | 67 | 7 b3 |
|
68 | 68 | $ hg help revsets | grep transplanted |
|
69 | 69 | "transplanted(set)" |
|
70 | 70 | |
|
71 | 71 | $ hg clone ../t ../prune |
|
72 | 72 | updating to branch default |
|
73 | 73 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
74 | 74 | $ cd ../prune |
|
75 | 75 | |
|
76 | 76 | $ hg up -C 1 |
|
77 | 77 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
78 | 78 | |
|
79 | 79 | rebase b onto r1, skipping b2 |
|
80 | 80 | |
|
81 | 81 | $ hg transplant -a -b tip -p 3 |
|
82 | 82 | applying 37a1297eb21b |
|
83 | 83 | 37a1297eb21b transplanted to e234d668f844 |
|
84 | 84 | applying a53251cdf717 |
|
85 | 85 | a53251cdf717 transplanted to 7275fda4d04f |
|
86 | 86 | $ hg log --template '{rev} {parents} {desc}\n' |
|
87 | 87 | 6 b3 |
|
88 | 88 | 5 1:d11e3596cc1a b1 |
|
89 | 89 | 4 b3 |
|
90 | 90 | 3 b2 |
|
91 | 91 | 2 0:17ab29e464c6 b1 |
|
92 | 92 | 1 r2 |
|
93 | 93 | 0 r1 |
|
94 | 94 | |
|
95 | 95 | |
|
96 | 96 | remote transplant |
|
97 | 97 | |
|
98 | 98 | $ hg clone -r 1 ../t ../remote |
|
99 | 99 | adding changesets |
|
100 | 100 | adding manifests |
|
101 | 101 | adding file changes |
|
102 | 102 | added 2 changesets with 2 changes to 2 files |
|
103 | 103 | updating to branch default |
|
104 | 104 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
105 | 105 | $ cd ../remote |
|
106 | 106 | $ hg transplant --log -s ../t 2 4 |
|
107 | 107 | searching for changes |
|
108 | 108 | applying 37a1297eb21b |
|
109 | 109 | 37a1297eb21b transplanted to c19cf0ccb069 |
|
110 | 110 | applying a53251cdf717 |
|
111 | 111 | a53251cdf717 transplanted to f7fe5bf98525 |
|
112 | 112 | $ hg log --template '{rev} {parents} {desc}\n' |
|
113 | 113 | 3 b3 |
|
114 | 114 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
115 | 115 | 2 b1 |
|
116 | 116 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
117 | 117 | 1 r2 |
|
118 | 118 | 0 r1 |
|
119 | 119 | |
|
120 | 120 | skip previous transplants |
|
121 | 121 | |
|
122 | 122 | $ hg transplant -s ../t -a -b 4 |
|
123 | 123 | searching for changes |
|
124 | 124 | applying 722f4667af76 |
|
125 | 125 | 722f4667af76 transplanted to 47156cd86c0b |
|
126 | 126 | $ hg log --template '{rev} {parents} {desc}\n' |
|
127 | 127 | 4 b2 |
|
128 | 128 | 3 b3 |
|
129 | 129 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
130 | 130 | 2 b1 |
|
131 | 131 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
132 | 132 | 1 r2 |
|
133 | 133 | 0 r1 |
|
134 | 134 | |
|
135 | 135 | skip local changes transplanted to the source |
|
136 | 136 | |
|
137 | 137 | $ echo b4 > b4 |
|
138 | 138 | $ hg ci -Amb4 -d '3 0' |
|
139 | 139 | adding b4 |
|
140 | 140 | $ hg clone ../t ../pullback |
|
141 | 141 | updating to branch default |
|
142 | 142 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
143 | 143 | $ cd ../pullback |
|
144 | 144 | $ hg transplant -s ../remote -a -b tip |
|
145 | 145 | searching for changes |
|
146 | 146 | applying 4333daefcb15 |
|
147 | 147 | 4333daefcb15 transplanted to 5f42c04e07cc |
|
148 | 148 | |
|
149 | 149 | |
|
150 | 150 | remote transplant with pull |
|
151 | 151 | |
|
152 | 152 | $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid |
|
153 | 153 | $ cat ../t.pid >> $DAEMON_PIDS |
|
154 | 154 | |
|
155 | 155 | $ hg clone -r 0 ../t ../rp |
|
156 | 156 | adding changesets |
|
157 | 157 | adding manifests |
|
158 | 158 | adding file changes |
|
159 | 159 | added 1 changesets with 1 changes to 1 files |
|
160 | 160 | updating to branch default |
|
161 | 161 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
162 | 162 | $ cd ../rp |
|
163 | 163 | $ hg transplant -s http://localhost:$HGPORT/ 2 4 |
|
164 | 164 | searching for changes |
|
165 | 165 | searching for changes |
|
166 | 166 | adding changesets |
|
167 | 167 | adding manifests |
|
168 | 168 | adding file changes |
|
169 | 169 | added 1 changesets with 1 changes to 1 files |
|
170 | 170 | applying a53251cdf717 |
|
171 | 171 | a53251cdf717 transplanted to 8d9279348abb |
|
172 | 172 | $ hg log --template '{rev} {parents} {desc}\n' |
|
173 | 173 | 2 b3 |
|
174 | 174 | 1 b1 |
|
175 | 175 | 0 r1 |
|
176 | 176 | |
|
177 | 177 | transplant --continue |
|
178 | 178 | |
|
179 | 179 | $ hg init ../tc |
|
180 | 180 | $ cd ../tc |
|
181 | 181 | $ cat <<EOF > foo |
|
182 | 182 | > foo |
|
183 | 183 | > bar |
|
184 | 184 | > baz |
|
185 | 185 | > EOF |
|
186 | 186 | $ echo toremove > toremove |
|
187 | 187 | $ hg ci -Amfoo |
|
188 | 188 | adding foo |
|
189 | 189 | adding toremove |
|
190 | 190 | $ cat <<EOF > foo |
|
191 | 191 | > foo2 |
|
192 | 192 | > bar2 |
|
193 | 193 | > baz2 |
|
194 | 194 | > EOF |
|
195 | 195 | $ rm toremove |
|
196 | 196 | $ echo added > added |
|
197 | 197 | $ hg ci -Amfoo2 |
|
198 | 198 | adding added |
|
199 | 199 | removing toremove |
|
200 | 200 | $ echo bar > bar |
|
201 | 201 | $ hg ci -Ambar |
|
202 | 202 | adding bar |
|
203 | 203 | $ echo bar2 >> bar |
|
204 | 204 | $ hg ci -mbar2 |
|
205 | 205 | $ hg up 0 |
|
206 | 206 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
207 | 207 | $ echo foobar > foo |
|
208 | 208 | $ hg ci -mfoobar |
|
209 | 209 | created new head |
|
210 | 210 | $ hg transplant 1:3 |
|
211 | 211 | applying a1e30dd1b8e7 |
|
212 | 212 | patching file foo |
|
213 | 213 | Hunk #1 FAILED at 0 |
|
214 | 214 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
215 | 215 | patch failed to apply |
|
216 | 216 | abort: fix up the merge and run hg transplant --continue |
|
217 | 217 | [255] |
|
218 | 218 | |
|
219 | 219 | transplant -c shouldn't use an old changeset |
|
220 | 220 | |
|
221 | 221 | $ hg up -C |
|
222 | 222 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
223 | 223 | $ rm added |
|
224 | 224 | $ hg transplant 1 |
|
225 | 225 | applying a1e30dd1b8e7 |
|
226 | 226 | patching file foo |
|
227 | 227 | Hunk #1 FAILED at 0 |
|
228 | 228 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
229 | 229 | patch failed to apply |
|
230 | 230 | abort: fix up the merge and run hg transplant --continue |
|
231 | 231 | [255] |
|
232 | 232 | $ hg transplant --continue |
|
233 | 233 | a1e30dd1b8e7 transplanted as f1563cf27039 |
|
234 | 234 | $ hg transplant 1:3 |
|
235 | 235 | skipping already applied revision 1:a1e30dd1b8e7 |
|
236 | 236 | applying 1739ac5f6139 |
|
237 | 237 | 1739ac5f6139 transplanted to d649c221319f |
|
238 | 238 | applying 0282d5fbbe02 |
|
239 | 239 | 0282d5fbbe02 transplanted to 77418277ccb3 |
|
240 | 240 | $ hg locate |
|
241 | 241 | added |
|
242 | 242 | bar |
|
243 | 243 | foo |
|
244 | 244 | $ cd .. |
|
245 | 245 | |
|
246 | 246 | Issue1111: Test transplant --merge |
|
247 | 247 | |
|
248 | 248 | $ hg init t1111 |
|
249 | 249 | $ cd t1111 |
|
250 | 250 | $ echo a > a |
|
251 | 251 | $ hg ci -Am adda |
|
252 | 252 | adding a |
|
253 | 253 | $ echo b >> a |
|
254 | 254 | $ hg ci -m appendb |
|
255 | 255 | $ echo c >> a |
|
256 | 256 | $ hg ci -m appendc |
|
257 | 257 | $ hg up -C 0 |
|
258 | 258 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
259 | 259 | $ echo d >> a |
|
260 | 260 | $ hg ci -m appendd |
|
261 | 261 | created new head |
|
262 | 262 | |
|
263 | 263 | tranplant |
|
264 | 264 | |
|
265 | 265 | $ hg transplant -m 1 |
|
266 | 266 | applying 42dc4432fd35 |
|
267 | 267 | 1:42dc4432fd35 merged at a9f4acbac129 |
|
268 | 268 | $ cd .. |
|
269 | 269 | |
|
270 | 270 | test transplant into empty repository |
|
271 | 271 | |
|
272 | 272 | $ hg init empty |
|
273 | 273 | $ cd empty |
|
274 | 274 | $ hg transplant -s ../t -b tip -a |
|
275 | 275 | adding changesets |
|
276 | 276 | adding manifests |
|
277 | 277 | adding file changes |
|
278 | 278 | added 4 changesets with 4 changes to 4 files |
|
279 | 279 | $ cd .. |
|
280 | 280 | |
|
281 | 281 | |
|
282 | 282 | test filter |
|
283 | 283 | |
|
284 | 284 | $ hg init filter |
|
285 | 285 | $ cd filter |
|
286 | 286 | $ cat <<'EOF' >test-filter |
|
287 | 287 | > #!/bin/sh |
|
288 | 288 | > sed 's/r1/r2/' $1 > $1.new |
|
289 | 289 | > mv $1.new $1 |
|
290 | 290 | > EOF |
|
291 | 291 | $ chmod +x test-filter |
|
292 | 292 | $ hg transplant -s ../t -b tip -a --filter ./test-filter |
|
293 | 293 | filtering * (glob) |
|
294 | 294 | applying 17ab29e464c6 |
|
295 | 295 | 17ab29e464c6 transplanted to e9ffc54ea104 |
|
296 | 296 | filtering * (glob) |
|
297 | 297 | applying 37a1297eb21b |
|
298 | 298 | 37a1297eb21b transplanted to 348b36d0b6a5 |
|
299 | 299 | filtering * (glob) |
|
300 | 300 | applying 722f4667af76 |
|
301 | 301 | 722f4667af76 transplanted to 0aa6979afb95 |
|
302 | 302 | filtering * (glob) |
|
303 | 303 | applying a53251cdf717 |
|
304 | 304 | a53251cdf717 transplanted to 14f8512272b5 |
|
305 | 305 | $ hg log --template '{rev} {parents} {desc}\n' |
|
306 | 306 | 3 b3 |
|
307 | 307 | 2 b2 |
|
308 | 308 | 1 b1 |
|
309 | 309 | 0 r2 |
|
310 | 310 | $ cd .. |
|
311 | 311 | |
|
312 | 312 | |
|
313 | 313 | test filter with failed patch |
|
314 | 314 | |
|
315 | 315 | $ cd filter |
|
316 | 316 | $ hg up 0 |
|
317 | 317 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
318 | 318 | $ echo foo > b1 |
|
319 | 319 | $ hg ci -Am foo |
|
320 | 320 | adding b1 |
|
321 | 321 | adding test-filter |
|
322 | 322 | created new head |
|
323 | 323 | $ hg transplant 1 --filter ./test-filter |
|
324 | 324 | filtering * (glob) |
|
325 | 325 | applying 348b36d0b6a5 |
|
326 | 326 | file b1 already exists |
|
327 | 327 | 1 out of 1 hunks FAILED -- saving rejects to file b1.rej |
|
328 | 328 | patch failed to apply |
|
329 | 329 | abort: fix up the merge and run hg transplant --continue |
|
330 | 330 | [255] |
|
331 | 331 | $ cd .. |
|
332 | 332 | |
|
333 | 333 | |
|
334 | 334 | test with a win32ext like setup (differing EOLs) |
|
335 | 335 | |
|
336 | 336 | $ hg init twin1 |
|
337 | 337 | $ cd twin1 |
|
338 | 338 | $ echo a > a |
|
339 | 339 | $ echo b > b |
|
340 | 340 | $ echo b >> b |
|
341 | 341 | $ hg ci -Am t |
|
342 | 342 | adding a |
|
343 | 343 | adding b |
|
344 | 344 | $ echo a > b |
|
345 | 345 | $ echo b >> b |
|
346 | 346 | $ hg ci -m changeb |
|
347 | 347 | $ cd .. |
|
348 | 348 | |
|
349 | 349 | $ hg init twin2 |
|
350 | 350 | $ cd twin2 |
|
351 | 351 | $ echo '[patch]' >> .hg/hgrc |
|
352 | 352 | $ echo 'eol = crlf' >> .hg/hgrc |
|
353 | 353 | $ python -c "file('b', 'wb').write('b\r\nb\r\n')" |
|
354 | $ hg ci -m addb | |
|
355 | nothing changed | |
|
356 | [1] | |
|
354 | $ hg ci -Am addb | |
|
355 | adding b | |
|
357 | 356 | $ hg transplant -s ../twin1 tip |
|
357 | searching for changes | |
|
358 | warning: repository is unrelated | |
|
358 | 359 | applying 2e849d776c17 |
|
359 |
2e849d776c17 transplanted to |
|
|
360 | 2e849d776c17 transplanted to 8e65bebc063e | |
|
360 | 361 | $ cat b |
|
361 | 362 | a\r (esc) |
|
362 | 363 | b\r (esc) |
|
363 | 364 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now