Show More
@@ -1,792 +1,795 b'' | |||
|
1 | 1 | #require killdaemons |
|
2 | 2 | |
|
3 | 3 | $ cat <<EOF >> $HGRCPATH |
|
4 | 4 | > [extensions] |
|
5 | 5 | > transplant= |
|
6 | 6 | > EOF |
|
7 | 7 | |
|
8 | 8 | $ hg init t |
|
9 | 9 | $ cd t |
|
10 | 10 | $ echo r1 > r1 |
|
11 | 11 | $ hg ci -Amr1 -d'0 0' |
|
12 | 12 | adding r1 |
|
13 | 13 | $ echo r2 > r2 |
|
14 | 14 | $ hg ci -Amr2 -d'1 0' |
|
15 | 15 | adding r2 |
|
16 | 16 | $ hg up 0 |
|
17 | 17 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
18 | 18 | |
|
19 | 19 | $ echo b1 > b1 |
|
20 | 20 | $ hg ci -Amb1 -d '0 0' |
|
21 | 21 | adding b1 |
|
22 | 22 | created new head |
|
23 | 23 | $ echo b2 > b2 |
|
24 | 24 | $ hg ci -Amb2 -d '1 0' |
|
25 | 25 | adding b2 |
|
26 | 26 | $ echo b3 > b3 |
|
27 | 27 | $ hg ci -Amb3 -d '2 0' |
|
28 | 28 | adding b3 |
|
29 | 29 | |
|
30 | 30 | $ hg log --template '{rev} {parents} {desc}\n' |
|
31 | 31 | 4 b3 |
|
32 | 32 | 3 b2 |
|
33 | 33 | 2 0:17ab29e464c6 b1 |
|
34 | 34 | 1 r2 |
|
35 | 35 | 0 r1 |
|
36 | 36 | |
|
37 | 37 | $ hg clone . ../rebase |
|
38 | 38 | updating to branch default |
|
39 | 39 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
40 | 40 | $ cd ../rebase |
|
41 | 41 | |
|
42 | 42 | $ hg up -C 1 |
|
43 | 43 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
44 | 44 | |
|
45 | 45 | rebase b onto r1 |
|
46 | 46 | (this also tests that editor is not invoked if '--edit' is not specified) |
|
47 | 47 | |
|
48 | 48 | $ HGEDITOR=cat hg transplant -a -b tip |
|
49 | 49 | applying 37a1297eb21b |
|
50 | 50 | 37a1297eb21b transplanted to e234d668f844 |
|
51 | 51 | applying 722f4667af76 |
|
52 | 52 | 722f4667af76 transplanted to 539f377d78df |
|
53 | 53 | applying a53251cdf717 |
|
54 | 54 | a53251cdf717 transplanted to ffd6818a3975 |
|
55 | 55 | $ hg log --template '{rev} {parents} {desc}\n' |
|
56 | 56 | 7 b3 |
|
57 | 57 | 6 b2 |
|
58 | 58 | 5 1:d11e3596cc1a b1 |
|
59 | 59 | 4 b3 |
|
60 | 60 | 3 b2 |
|
61 | 61 | 2 0:17ab29e464c6 b1 |
|
62 | 62 | 1 r2 |
|
63 | 63 | 0 r1 |
|
64 | 64 | |
|
65 | 65 | test transplanted revset |
|
66 | 66 | |
|
67 | 67 | $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n' |
|
68 | 68 | 5 1:d11e3596cc1a b1 |
|
69 | 69 | 6 b2 |
|
70 | 70 | 7 b3 |
|
71 | 71 | $ hg help revsets | grep transplanted |
|
72 | 72 | "transplanted([set])" |
|
73 | 73 | Transplanted changesets in set, or all transplanted changesets. |
|
74 | 74 | |
|
75 | 75 | test transplanted keyword |
|
76 | 76 | |
|
77 | 77 | $ hg log --template '{rev} {transplanted}\n' |
|
78 | 78 | 7 a53251cdf717679d1907b289f991534be05c997a |
|
79 | 79 | 6 722f4667af767100cb15b6a79324bf8abbfe1ef4 |
|
80 | 80 | 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21 |
|
81 | 81 | 4 |
|
82 | 82 | 3 |
|
83 | 83 | 2 |
|
84 | 84 | 1 |
|
85 | 85 | 0 |
|
86 | 86 | |
|
87 | 87 | test destination() revset predicate with a transplant of a transplant; new |
|
88 | 88 | clone so subsequent rollback isn't affected |
|
89 | 89 | (this also tests that editor is invoked if '--edit' is specified) |
|
90 | 90 | |
|
91 | 91 | $ hg clone -q . ../destination |
|
92 | 92 | $ cd ../destination |
|
93 | 93 | $ hg up -Cq 0 |
|
94 | 94 | $ hg branch -q b4 |
|
95 | 95 | $ hg ci -qm "b4" |
|
96 | 96 | $ hg status --rev "7^1" --rev 7 |
|
97 | 97 | A b3 |
|
98 | 98 | $ cat > $TESTTMP/checkeditform.sh <<EOF |
|
99 | 99 | > env | grep HGEDITFORM |
|
100 | 100 | > true |
|
101 | 101 | > EOF |
|
102 | 102 | $ cat > $TESTTMP/checkeditform-n-cat.sh <<EOF |
|
103 | 103 | > env | grep HGEDITFORM |
|
104 | 104 | > cat \$* |
|
105 | 105 | > EOF |
|
106 | 106 | $ HGEDITOR="sh $TESTTMP/checkeditform-n-cat.sh" hg transplant --edit 7 |
|
107 | 107 | applying ffd6818a3975 |
|
108 | 108 | HGEDITFORM=transplant.normal |
|
109 | 109 | b3 |
|
110 | 110 | |
|
111 | 111 | |
|
112 | 112 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
113 | 113 | HG: Leave message empty to abort commit. |
|
114 | 114 | HG: -- |
|
115 | 115 | HG: user: test |
|
116 | 116 | HG: branch 'b4' |
|
117 | 117 | HG: added b3 |
|
118 | 118 | ffd6818a3975 transplanted to 502236fa76bb |
|
119 | 119 | |
|
120 | 120 | |
|
121 | 121 | $ hg log -r 'destination()' |
|
122 | 122 | changeset: 5:e234d668f844 |
|
123 | 123 | parent: 1:d11e3596cc1a |
|
124 | 124 | user: test |
|
125 | 125 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
126 | 126 | summary: b1 |
|
127 | 127 | |
|
128 | 128 | changeset: 6:539f377d78df |
|
129 | 129 | user: test |
|
130 | 130 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
131 | 131 | summary: b2 |
|
132 | 132 | |
|
133 | 133 | changeset: 7:ffd6818a3975 |
|
134 | 134 | user: test |
|
135 | 135 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
136 | 136 | summary: b3 |
|
137 | 137 | |
|
138 | 138 | changeset: 9:502236fa76bb |
|
139 | 139 | branch: b4 |
|
140 | 140 | tag: tip |
|
141 | 141 | user: test |
|
142 | 142 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
143 | 143 | summary: b3 |
|
144 | 144 | |
|
145 | 145 | $ hg log -r 'destination(a53251cdf717)' |
|
146 | 146 | changeset: 7:ffd6818a3975 |
|
147 | 147 | user: test |
|
148 | 148 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
149 | 149 | summary: b3 |
|
150 | 150 | |
|
151 | 151 | changeset: 9:502236fa76bb |
|
152 | 152 | branch: b4 |
|
153 | 153 | tag: tip |
|
154 | 154 | user: test |
|
155 | 155 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
156 | 156 | summary: b3 |
|
157 | 157 | |
|
158 | 158 | |
|
159 | 159 | test subset parameter in reverse order |
|
160 | 160 | $ hg log -r 'reverse(all()) and destination(a53251cdf717)' |
|
161 | 161 | changeset: 9:502236fa76bb |
|
162 | 162 | branch: b4 |
|
163 | 163 | tag: tip |
|
164 | 164 | user: test |
|
165 | 165 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
166 | 166 | summary: b3 |
|
167 | 167 | |
|
168 | 168 | changeset: 7:ffd6818a3975 |
|
169 | 169 | user: test |
|
170 | 170 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
171 | 171 | summary: b3 |
|
172 | 172 | |
|
173 | 173 | |
|
174 | 174 | back to the original dir |
|
175 | 175 | $ cd ../rebase |
|
176 | 176 | |
|
177 | 177 | rollback the transplant |
|
178 | 178 | $ hg rollback |
|
179 | 179 | repository tip rolled back to revision 4 (undo transplant) |
|
180 | 180 | working directory now based on revision 1 |
|
181 | 181 | $ hg tip -q |
|
182 | 182 | 4:a53251cdf717 |
|
183 | 183 | $ hg parents -q |
|
184 | 184 | 1:d11e3596cc1a |
|
185 | 185 | $ hg status |
|
186 | 186 | ? b1 |
|
187 | 187 | ? b2 |
|
188 | 188 | ? b3 |
|
189 | 189 | |
|
190 | 190 | $ hg clone ../t ../prune |
|
191 | 191 | updating to branch default |
|
192 | 192 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
193 | 193 | $ cd ../prune |
|
194 | 194 | |
|
195 | 195 | $ hg up -C 1 |
|
196 | 196 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
197 | 197 | |
|
198 | 198 | rebase b onto r1, skipping b2 |
|
199 | 199 | |
|
200 | 200 | $ hg transplant -a -b tip -p 3 |
|
201 | 201 | applying 37a1297eb21b |
|
202 | 202 | 37a1297eb21b transplanted to e234d668f844 |
|
203 | 203 | applying a53251cdf717 |
|
204 | 204 | a53251cdf717 transplanted to 7275fda4d04f |
|
205 | 205 | $ hg log --template '{rev} {parents} {desc}\n' |
|
206 | 206 | 6 b3 |
|
207 | 207 | 5 1:d11e3596cc1a b1 |
|
208 | 208 | 4 b3 |
|
209 | 209 | 3 b2 |
|
210 | 210 | 2 0:17ab29e464c6 b1 |
|
211 | 211 | 1 r2 |
|
212 | 212 | 0 r1 |
|
213 | 213 | |
|
214 | 214 | test same-parent transplant with --log |
|
215 | 215 | |
|
216 | 216 | $ hg clone -r 1 ../t ../sameparent |
|
217 | 217 | adding changesets |
|
218 | 218 | adding manifests |
|
219 | 219 | adding file changes |
|
220 | 220 | added 2 changesets with 2 changes to 2 files |
|
221 | 221 | updating to branch default |
|
222 | 222 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
223 | 223 | $ cd ../sameparent |
|
224 | 224 | $ hg transplant --log -s ../prune 5 |
|
225 | 225 | searching for changes |
|
226 | 226 | applying e234d668f844 |
|
227 | 227 | e234d668f844 transplanted to e07aea8ecf9c |
|
228 | 228 | $ hg log --template '{rev} {parents} {desc}\n' |
|
229 | 229 | 2 b1 |
|
230 | 230 | (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170) |
|
231 | 231 | 1 r2 |
|
232 | 232 | 0 r1 |
|
233 | 233 | remote transplant, and also test that transplant doesn't break with |
|
234 | 234 | format-breaking diffopts |
|
235 | 235 | |
|
236 | 236 | $ hg clone -r 1 ../t ../remote |
|
237 | 237 | adding changesets |
|
238 | 238 | adding manifests |
|
239 | 239 | adding file changes |
|
240 | 240 | added 2 changesets with 2 changes to 2 files |
|
241 | 241 | updating to branch default |
|
242 | 242 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
243 | 243 | $ cd ../remote |
|
244 | 244 | $ hg --config diff.noprefix=True transplant --log -s ../t 2 4 |
|
245 | 245 | searching for changes |
|
246 | 246 | applying 37a1297eb21b |
|
247 | 247 | 37a1297eb21b transplanted to c19cf0ccb069 |
|
248 | 248 | applying a53251cdf717 |
|
249 | 249 | a53251cdf717 transplanted to f7fe5bf98525 |
|
250 | 250 | $ hg log --template '{rev} {parents} {desc}\n' |
|
251 | 251 | 3 b3 |
|
252 | 252 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
253 | 253 | 2 b1 |
|
254 | 254 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
255 | 255 | 1 r2 |
|
256 | 256 | 0 r1 |
|
257 | 257 | |
|
258 | 258 | skip previous transplants |
|
259 | 259 | |
|
260 | 260 | $ hg transplant -s ../t -a -b 4 |
|
261 | 261 | searching for changes |
|
262 | 262 | applying 722f4667af76 |
|
263 | 263 | 722f4667af76 transplanted to 47156cd86c0b |
|
264 | 264 | $ hg log --template '{rev} {parents} {desc}\n' |
|
265 | 265 | 4 b2 |
|
266 | 266 | 3 b3 |
|
267 | 267 | (transplanted from a53251cdf717679d1907b289f991534be05c997a) |
|
268 | 268 | 2 b1 |
|
269 | 269 | (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21) |
|
270 | 270 | 1 r2 |
|
271 | 271 | 0 r1 |
|
272 | 272 | |
|
273 | 273 | skip local changes transplanted to the source |
|
274 | 274 | |
|
275 | 275 | $ echo b4 > b4 |
|
276 | 276 | $ hg ci -Amb4 -d '3 0' |
|
277 | 277 | adding b4 |
|
278 | 278 | $ hg clone ../t ../pullback |
|
279 | 279 | updating to branch default |
|
280 | 280 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
281 | 281 | $ cd ../pullback |
|
282 | 282 | $ hg transplant -s ../remote -a -b tip |
|
283 | 283 | searching for changes |
|
284 | 284 | applying 4333daefcb15 |
|
285 | 285 | 4333daefcb15 transplanted to 5f42c04e07cc |
|
286 | 286 | |
|
287 | 287 | |
|
288 | 288 | remote transplant with pull |
|
289 | 289 | |
|
290 | 290 | $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid |
|
291 | 291 | $ cat ../t.pid >> $DAEMON_PIDS |
|
292 | 292 | |
|
293 | 293 | $ hg clone -r 0 ../t ../rp |
|
294 | 294 | adding changesets |
|
295 | 295 | adding manifests |
|
296 | 296 | adding file changes |
|
297 | 297 | added 1 changesets with 1 changes to 1 files |
|
298 | 298 | updating to branch default |
|
299 | 299 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
300 | 300 | $ cd ../rp |
|
301 |
$ hg transplant -s http://localhost:$HGPORT/ |
|
|
301 | $ hg transplant -s http://localhost:$HGPORT/ 37a1297eb21b a53251cdf717 | |
|
302 | 302 | searching for changes |
|
303 | 303 | searching for changes |
|
304 | 304 | adding changesets |
|
305 | 305 | adding manifests |
|
306 | 306 | adding file changes |
|
307 | 307 | added 1 changesets with 1 changes to 1 files |
|
308 | 308 | applying a53251cdf717 |
|
309 | 309 | a53251cdf717 transplanted to 8d9279348abb |
|
310 | 310 | $ hg log --template '{rev} {parents} {desc}\n' |
|
311 | 311 | 2 b3 |
|
312 | 312 | 1 b1 |
|
313 | 313 | 0 r1 |
|
314 | 314 | |
|
315 | 315 | remote transplant without pull |
|
316 | (I'm pretty sure this test is actually pulling, | |
|
317 | It was using "2" and "4" (as the previous transplant used to) which referenced | |
|
318 | revision different from one run to another) | |
|
316 | 319 | |
|
317 | 320 | $ hg pull -q http://localhost:$HGPORT/ |
|
318 | $ hg transplant -s http://localhost:$HGPORT/ 2 4 | |
|
321 | $ hg transplant -s http://localhost:$HGPORT/ 8d9279348abb 722f4667af76 | |
|
319 | 322 | searching for changes |
|
320 | 323 | skipping already applied revision 2:8d9279348abb |
|
321 | 324 | applying 722f4667af76 |
|
322 | 325 | 722f4667af76 transplanted to 76e321915884 |
|
323 | 326 | |
|
324 | 327 | transplant --continue |
|
325 | 328 | |
|
326 | 329 | $ hg init ../tc |
|
327 | 330 | $ cd ../tc |
|
328 | 331 | $ cat <<EOF > foo |
|
329 | 332 | > foo |
|
330 | 333 | > bar |
|
331 | 334 | > baz |
|
332 | 335 | > EOF |
|
333 | 336 |
$ |
|
334 | 337 |
$ |
|
335 | 338 |
$ |
|
336 | 339 |
|
|
337 | 340 |
|
|
338 | 341 |
|
|
339 | 342 |
$ |
|
340 | 343 | > foo2 |
|
341 | 344 | > bar2 |
|
342 | 345 | > baz2 |
|
343 | 346 | > EOF |
|
344 | 347 |
$ |
|
345 | 348 |
$ |
|
346 | 349 |
$ |
|
347 | 350 |
|
|
348 | 351 |
|
|
349 | 352 |
$ |
|
350 | 353 |
$ |
|
351 | 354 |
> before |
|
352 | 355 | > baz |
|
353 | 356 |
> after |
|
354 | 357 | > EOF |
|
355 | 358 |
$ |
|
356 | 359 |
|
|
357 | 360 |
$ |
|
358 | 361 | $ hg ci -mbar2 |
|
359 | 362 | $ hg up 0 |
|
360 | 363 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
361 | 364 | $ echo foobar > foo |
|
362 | 365 | $ hg ci -mfoobar |
|
363 | 366 | created new head |
|
364 | 367 | $ hg transplant 1:3 |
|
365 | 368 | applying 46ae92138f3c |
|
366 | 369 | patching file foo |
|
367 | 370 | Hunk #1 FAILED at 0 |
|
368 | 371 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
369 | 372 | patch failed to apply |
|
370 | 373 | abort: fix up the merge and run hg transplant --continue |
|
371 | 374 | [255] |
|
372 | 375 | |
|
373 | 376 | transplant -c shouldn't use an old changeset |
|
374 | 377 | |
|
375 | 378 | $ hg up -C |
|
376 | 379 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
377 | 380 | $ rm added |
|
378 | 381 | $ hg transplant 1 |
|
379 | 382 | applying 46ae92138f3c |
|
380 | 383 | patching file foo |
|
381 | 384 | Hunk #1 FAILED at 0 |
|
382 | 385 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
383 | 386 | patch failed to apply |
|
384 | 387 | abort: fix up the merge and run hg transplant --continue |
|
385 | 388 | [255] |
|
386 | 389 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e |
|
387 | 390 | HGEDITFORM=transplant.normal |
|
388 | 391 | 46ae92138f3c transplanted as 9159dada197d |
|
389 | 392 | $ hg transplant 1:3 |
|
390 | 393 | skipping already applied revision 1:46ae92138f3c |
|
391 | 394 | applying 9d6d6b5a8275 |
|
392 | 395 | 9d6d6b5a8275 transplanted to 2d17a10c922f |
|
393 | 396 | applying 1dab759070cf |
|
394 | 397 | 1dab759070cf transplanted to e06a69927eb0 |
|
395 | 398 | $ hg locate |
|
396 | 399 | added |
|
397 | 400 | bar |
|
398 | 401 | baz |
|
399 | 402 | foo |
|
400 | 403 | |
|
401 | 404 | test multiple revisions and --continue |
|
402 | 405 | |
|
403 | 406 | $ hg up -qC 0 |
|
404 | 407 | $ echo bazbaz > baz |
|
405 | 408 | $ hg ci -Am anotherbaz baz |
|
406 | 409 | created new head |
|
407 | 410 | $ hg transplant 1:3 |
|
408 | 411 | applying 46ae92138f3c |
|
409 | 412 | 46ae92138f3c transplanted to 1024233ea0ba |
|
410 | 413 | applying 9d6d6b5a8275 |
|
411 | 414 | patching file baz |
|
412 | 415 | Hunk #1 FAILED at 0 |
|
413 | 416 | 1 out of 1 hunks FAILED -- saving rejects to file baz.rej |
|
414 | 417 | patch failed to apply |
|
415 | 418 | abort: fix up the merge and run hg transplant --continue |
|
416 | 419 | [255] |
|
417 | 420 | $ echo fixed > baz |
|
418 | 421 | $ hg transplant --continue |
|
419 | 422 | 9d6d6b5a8275 transplanted as d80c49962290 |
|
420 | 423 | applying 1dab759070cf |
|
421 | 424 | 1dab759070cf transplanted to aa0ffe6bd5ae |
|
422 | 425 | |
|
423 | 426 | $ cd .. |
|
424 | 427 | |
|
425 | 428 | Issue1111: Test transplant --merge |
|
426 | 429 | |
|
427 | 430 | $ hg init t1111 |
|
428 | 431 | $ cd t1111 |
|
429 | 432 | $ echo a > a |
|
430 | 433 | $ hg ci -Am adda |
|
431 | 434 | adding a |
|
432 | 435 | $ echo b >> a |
|
433 | 436 | $ hg ci -m appendb |
|
434 | 437 | $ echo c >> a |
|
435 | 438 | $ hg ci -m appendc |
|
436 | 439 | $ hg up -C 0 |
|
437 | 440 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
438 | 441 | $ echo d >> a |
|
439 | 442 | $ hg ci -m appendd |
|
440 | 443 | created new head |
|
441 | 444 | |
|
442 | 445 |
|
|
443 | 446 | |
|
444 | 447 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e |
|
445 | 448 | applying 42dc4432fd35 |
|
446 | 449 | HGEDITFORM=transplant.merge |
|
447 | 450 | 1:42dc4432fd35 merged at a9f4acbac129 |
|
448 | 451 | $ hg update -q -C 2 |
|
449 | 452 | $ cat > a <<EOF |
|
450 | 453 | > x |
|
451 | 454 | > y |
|
452 | 455 | > z |
|
453 | 456 | > EOF |
|
454 | 457 | $ hg commit -m replace |
|
455 | 458 | $ hg update -q -C 4 |
|
456 | 459 | $ hg transplant -m 5 |
|
457 | 460 | applying 600a3cdcb41d |
|
458 | 461 | patching file a |
|
459 | 462 | Hunk #1 FAILED at 0 |
|
460 | 463 | 1 out of 1 hunks FAILED -- saving rejects to file a.rej |
|
461 | 464 | patch failed to apply |
|
462 | 465 | abort: fix up the merge and run hg transplant --continue |
|
463 | 466 | [255] |
|
464 | 467 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e |
|
465 | 468 | HGEDITFORM=transplant.merge |
|
466 | 469 | 600a3cdcb41d transplanted as a3f88be652e0 |
|
467 | 470 | |
|
468 | 471 | $ cd .. |
|
469 | 472 | |
|
470 | 473 | test transplant into empty repository |
|
471 | 474 | |
|
472 | 475 | $ hg init empty |
|
473 | 476 | $ cd empty |
|
474 | 477 | $ hg transplant -s ../t -b tip -a |
|
475 | 478 | adding changesets |
|
476 | 479 | adding manifests |
|
477 | 480 | adding file changes |
|
478 | 481 | added 4 changesets with 4 changes to 4 files |
|
479 | 482 | |
|
480 | 483 | test "--merge" causing pull from source repository on local host |
|
481 | 484 | |
|
482 | 485 | $ hg --config extensions.mq= -q strip 2 |
|
483 | 486 | $ hg transplant -s ../t --merge tip |
|
484 | 487 | searching for changes |
|
485 | 488 | searching for changes |
|
486 | 489 | adding changesets |
|
487 | 490 | adding manifests |
|
488 | 491 | adding file changes |
|
489 | 492 | added 2 changesets with 2 changes to 2 files |
|
490 | 493 | applying a53251cdf717 |
|
491 | 494 | 4:a53251cdf717 merged at 4831f4dc831a |
|
492 | 495 | |
|
493 | 496 | test interactive transplant |
|
494 | 497 | |
|
495 | 498 | $ hg --config extensions.strip= -q strip 0 |
|
496 | 499 | $ hg -R ../t log -G --template "{rev}:{node|short}" |
|
497 | 500 | @ 4:a53251cdf717 |
|
498 | 501 | | |
|
499 | 502 | o 3:722f4667af76 |
|
500 | 503 | | |
|
501 | 504 | o 2:37a1297eb21b |
|
502 | 505 | | |
|
503 | 506 | | o 1:d11e3596cc1a |
|
504 | 507 | |/ |
|
505 | 508 | o 0:17ab29e464c6 |
|
506 | 509 | |
|
507 | 510 | $ hg transplant -q --config ui.interactive=true -s ../t <<EOF |
|
508 | 511 | > p |
|
509 | 512 | > y |
|
510 | 513 | > n |
|
511 | 514 | > n |
|
512 | 515 | > m |
|
513 | 516 | > c |
|
514 | 517 | > EOF |
|
515 | 518 | 0:17ab29e464c6 |
|
516 | 519 | apply changeset? [ynmpcq?]: p |
|
517 | 520 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
518 | 521 | +++ b/r1 Thu Jan 01 00:00:00 1970 +0000 |
|
519 | 522 | @@ -0,0 +1,1 @@ |
|
520 | 523 | +r1 |
|
521 | 524 | apply changeset? [ynmpcq?]: y |
|
522 | 525 | 1:d11e3596cc1a |
|
523 | 526 | apply changeset? [ynmpcq?]: n |
|
524 | 527 | 2:37a1297eb21b |
|
525 | 528 | apply changeset? [ynmpcq?]: n |
|
526 | 529 | 3:722f4667af76 |
|
527 | 530 | apply changeset? [ynmpcq?]: m |
|
528 | 531 | 4:a53251cdf717 |
|
529 | 532 | apply changeset? [ynmpcq?]: c |
|
530 | 533 | $ hg log -G --template "{node|short}" |
|
531 | 534 | @ 88be5dde5260 |
|
532 | 535 | |\ |
|
533 | 536 | | o 722f4667af76 |
|
534 | 537 | | | |
|
535 | 538 | | o 37a1297eb21b |
|
536 | 539 | |/ |
|
537 | 540 | o 17ab29e464c6 |
|
538 | 541 | |
|
539 | 542 | $ hg transplant -q --config ui.interactive=true -s ../t <<EOF |
|
540 | 543 | > x |
|
541 | 544 | > ? |
|
542 | 545 | > y |
|
543 | 546 | > q |
|
544 | 547 | > EOF |
|
545 | 548 | 1:d11e3596cc1a |
|
546 | 549 | apply changeset? [ynmpcq?]: x |
|
547 | 550 | unrecognized response |
|
548 | 551 | apply changeset? [ynmpcq?]: ? |
|
549 | 552 | y: yes, transplant this changeset |
|
550 | 553 | n: no, skip this changeset |
|
551 | 554 | m: merge at this changeset |
|
552 | 555 | p: show patch |
|
553 | 556 | c: commit selected changesets |
|
554 | 557 | q: quit and cancel transplant |
|
555 | 558 | ?: ? (show this help) |
|
556 | 559 | apply changeset? [ynmpcq?]: y |
|
557 | 560 | 4:a53251cdf717 |
|
558 | 561 | apply changeset? [ynmpcq?]: q |
|
559 | 562 | $ hg heads --template "{node|short}\n" |
|
560 | 563 | 88be5dde5260 |
|
561 | 564 | |
|
562 | 565 | $ cd .. |
|
563 | 566 | |
|
564 | 567 | |
|
565 | 568 | #if unix-permissions system-sh |
|
566 | 569 | |
|
567 | 570 | test filter |
|
568 | 571 | |
|
569 | 572 | $ hg init filter |
|
570 | 573 | $ cd filter |
|
571 | 574 | $ cat <<'EOF' >test-filter |
|
572 | 575 | > #!/bin/sh |
|
573 | 576 | > sed 's/r1/r2/' $1 > $1.new |
|
574 | 577 | > mv $1.new $1 |
|
575 | 578 | > EOF |
|
576 | 579 | $ chmod +x test-filter |
|
577 | 580 | $ hg transplant -s ../t -b tip -a --filter ./test-filter |
|
578 | 581 | filtering * (glob) |
|
579 | 582 | applying 17ab29e464c6 |
|
580 | 583 | 17ab29e464c6 transplanted to e9ffc54ea104 |
|
581 | 584 | filtering * (glob) |
|
582 | 585 | applying 37a1297eb21b |
|
583 | 586 | 37a1297eb21b transplanted to 348b36d0b6a5 |
|
584 | 587 | filtering * (glob) |
|
585 | 588 | applying 722f4667af76 |
|
586 | 589 | 722f4667af76 transplanted to 0aa6979afb95 |
|
587 | 590 | filtering * (glob) |
|
588 | 591 | applying a53251cdf717 |
|
589 | 592 | a53251cdf717 transplanted to 14f8512272b5 |
|
590 | 593 | $ hg log --template '{rev} {parents} {desc}\n' |
|
591 | 594 | 3 b3 |
|
592 | 595 | 2 b2 |
|
593 | 596 | 1 b1 |
|
594 | 597 | 0 r2 |
|
595 | 598 | $ cd .. |
|
596 | 599 | |
|
597 | 600 | |
|
598 | 601 | test filter with failed patch |
|
599 | 602 | |
|
600 | 603 | $ cd filter |
|
601 | 604 | $ hg up 0 |
|
602 | 605 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
603 | 606 | $ echo foo > b1 |
|
604 | 607 | $ hg ci -Am foo |
|
605 | 608 | adding b1 |
|
606 | 609 | adding test-filter |
|
607 | 610 | created new head |
|
608 | 611 | $ hg transplant 1 --filter ./test-filter |
|
609 | 612 | filtering * (glob) |
|
610 | 613 | applying 348b36d0b6a5 |
|
611 | 614 | file b1 already exists |
|
612 | 615 | 1 out of 1 hunks FAILED -- saving rejects to file b1.rej |
|
613 | 616 | patch failed to apply |
|
614 | 617 | abort: fix up the merge and run hg transplant --continue |
|
615 | 618 | [255] |
|
616 | 619 | $ cd .. |
|
617 | 620 | |
|
618 | 621 | test environment passed to filter |
|
619 | 622 | |
|
620 | 623 | $ hg init filter-environment |
|
621 | 624 | $ cd filter-environment |
|
622 | 625 | $ cat <<'EOF' >test-filter-environment |
|
623 | 626 | > #!/bin/sh |
|
624 | 627 | > echo "Transplant by $HGUSER" >> $1 |
|
625 | 628 | > echo "Transplant from rev $HGREVISION" >> $1 |
|
626 | 629 | > EOF |
|
627 | 630 | $ chmod +x test-filter-environment |
|
628 | 631 | $ hg transplant -s ../t --filter ./test-filter-environment 0 |
|
629 | 632 | filtering * (glob) |
|
630 | 633 | applying 17ab29e464c6 |
|
631 | 634 | 17ab29e464c6 transplanted to 5190e68026a0 |
|
632 | 635 | |
|
633 | 636 | $ hg log --template '{rev} {parents} {desc}\n' |
|
634 | 637 | 0 r1 |
|
635 | 638 | Transplant by test |
|
636 | 639 | Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f |
|
637 | 640 | $ cd .. |
|
638 | 641 | |
|
639 | 642 | test transplant with filter handles invalid changelog |
|
640 | 643 | |
|
641 | 644 | $ hg init filter-invalid-log |
|
642 | 645 | $ cd filter-invalid-log |
|
643 | 646 | $ cat <<'EOF' >test-filter-invalid-log |
|
644 | 647 | > #!/bin/sh |
|
645 | 648 | > echo "" > $1 |
|
646 | 649 | > EOF |
|
647 | 650 | $ chmod +x test-filter-invalid-log |
|
648 | 651 | $ hg transplant -s ../t --filter ./test-filter-invalid-log 0 |
|
649 | 652 | filtering * (glob) |
|
650 | 653 | abort: filter corrupted changeset (no user or date) |
|
651 | 654 | [255] |
|
652 | 655 | $ cd .. |
|
653 | 656 | |
|
654 | 657 | #endif |
|
655 | 658 | |
|
656 | 659 | |
|
657 | 660 | test with a win32ext like setup (differing EOLs) |
|
658 | 661 | |
|
659 | 662 | $ hg init twin1 |
|
660 | 663 | $ cd twin1 |
|
661 | 664 | $ echo a > a |
|
662 | 665 | $ echo b > b |
|
663 | 666 | $ echo b >> b |
|
664 | 667 | $ hg ci -Am t |
|
665 | 668 | adding a |
|
666 | 669 | adding b |
|
667 | 670 | $ echo a > b |
|
668 | 671 | $ echo b >> b |
|
669 | 672 | $ hg ci -m changeb |
|
670 | 673 | $ cd .. |
|
671 | 674 | |
|
672 | 675 | $ hg init twin2 |
|
673 | 676 | $ cd twin2 |
|
674 | 677 | $ echo '[patch]' >> .hg/hgrc |
|
675 | 678 | $ echo 'eol = crlf' >> .hg/hgrc |
|
676 | 679 | $ $PYTHON -c "file('b', 'wb').write('b\r\nb\r\n')" |
|
677 | 680 | $ hg ci -Am addb |
|
678 | 681 | adding b |
|
679 | 682 | $ hg transplant -s ../twin1 tip |
|
680 | 683 | searching for changes |
|
681 | 684 | warning: repository is unrelated |
|
682 | 685 | applying 2e849d776c17 |
|
683 | 686 | 2e849d776c17 transplanted to 8e65bebc063e |
|
684 | 687 | $ cat b |
|
685 | 688 | a\r (esc) |
|
686 | 689 | b\r (esc) |
|
687 | 690 | $ cd .. |
|
688 | 691 | |
|
689 | 692 | test transplant with merge changeset is skipped |
|
690 | 693 | |
|
691 | 694 | $ hg init merge1a |
|
692 | 695 | $ cd merge1a |
|
693 | 696 | $ echo a > a |
|
694 | 697 | $ hg ci -Am a |
|
695 | 698 | adding a |
|
696 | 699 | $ hg branch b |
|
697 | 700 | marked working directory as branch b |
|
698 | 701 | (branches are permanent and global, did you want a bookmark?) |
|
699 | 702 | $ hg ci -m branchb |
|
700 | 703 | $ echo b > b |
|
701 | 704 | $ hg ci -Am b |
|
702 | 705 | adding b |
|
703 | 706 | $ hg update default |
|
704 | 707 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
705 | 708 | $ hg merge b |
|
706 | 709 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
707 | 710 | (branch merge, don't forget to commit) |
|
708 | 711 | $ hg ci -m mergeb |
|
709 | 712 | $ cd .. |
|
710 | 713 | |
|
711 | 714 | $ hg init merge1b |
|
712 | 715 | $ cd merge1b |
|
713 | 716 | $ hg transplant -s ../merge1a tip |
|
714 | 717 | $ cd .. |
|
715 | 718 | |
|
716 | 719 | test transplant with merge changeset accepts --parent |
|
717 | 720 | |
|
718 | 721 | $ hg init merge2a |
|
719 | 722 | $ cd merge2a |
|
720 | 723 | $ echo a > a |
|
721 | 724 | $ hg ci -Am a |
|
722 | 725 | adding a |
|
723 | 726 | $ hg branch b |
|
724 | 727 | marked working directory as branch b |
|
725 | 728 | (branches are permanent and global, did you want a bookmark?) |
|
726 | 729 | $ hg ci -m branchb |
|
727 | 730 | $ echo b > b |
|
728 | 731 | $ hg ci -Am b |
|
729 | 732 | adding b |
|
730 | 733 | $ hg update default |
|
731 | 734 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
732 | 735 | $ hg merge b |
|
733 | 736 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
734 | 737 | (branch merge, don't forget to commit) |
|
735 | 738 | $ hg ci -m mergeb |
|
736 | 739 | $ cd .. |
|
737 | 740 | |
|
738 | 741 | $ hg init merge2b |
|
739 | 742 | $ cd merge2b |
|
740 | 743 | $ hg transplant -s ../merge2a --parent 0 tip |
|
741 | 744 | applying be9f9b39483f |
|
742 | 745 | be9f9b39483f transplanted to 9959e51f94d1 |
|
743 | 746 | $ cd .. |
|
744 | 747 | |
|
745 | 748 | test transplanting a patch turning into a no-op |
|
746 | 749 | |
|
747 | 750 | $ hg init binarysource |
|
748 | 751 | $ cd binarysource |
|
749 | 752 | $ echo a > a |
|
750 | 753 | $ hg ci -Am adda a |
|
751 | 754 | >>> file('b', 'wb').write('\0b1') |
|
752 | 755 | $ hg ci -Am addb b |
|
753 | 756 | >>> file('b', 'wb').write('\0b2') |
|
754 | 757 | $ hg ci -m changeb b |
|
755 | 758 | $ cd .. |
|
756 | 759 | |
|
757 | 760 | $ hg clone -r0 binarysource binarydest |
|
758 | 761 | adding changesets |
|
759 | 762 | adding manifests |
|
760 | 763 | adding file changes |
|
761 | 764 | added 1 changesets with 1 changes to 1 files |
|
762 | 765 | updating to branch default |
|
763 | 766 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
764 | 767 | $ cd binarydest |
|
765 | 768 | $ cp ../binarysource/b b |
|
766 | 769 | $ hg ci -Am addb2 b |
|
767 | 770 | $ hg transplant -s ../binarysource 2 |
|
768 | 771 | searching for changes |
|
769 | 772 | applying 7a7d57e15850 |
|
770 | 773 | skipping emptied changeset 7a7d57e15850 |
|
771 | 774 | |
|
772 | 775 | Test empty result in --continue |
|
773 | 776 | |
|
774 | 777 | $ hg transplant -s ../binarysource 1 |
|
775 | 778 | searching for changes |
|
776 | 779 | applying 645035761929 |
|
777 | 780 | file b already exists |
|
778 | 781 | 1 out of 1 hunks FAILED -- saving rejects to file b.rej |
|
779 | 782 | patch failed to apply |
|
780 | 783 | abort: fix up the merge and run hg transplant --continue |
|
781 | 784 | [255] |
|
782 | 785 | $ hg status |
|
783 | 786 | ? b.rej |
|
784 | 787 | $ hg transplant --continue |
|
785 | 788 | 645035761929 skipped due to empty diff |
|
786 | 789 | |
|
787 | 790 | $ cd .. |
|
788 | 791 | |
|
789 | 792 | Explicitly kill daemons to let the test exit on Windows |
|
790 | 793 | |
|
791 | 794 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
792 | 795 |
General Comments 0
You need to be logged in to leave comments.
Login now