##// END OF EJS Templates
tests: split out another ~1/2 of test-graft.t...
Martin von Zweigbergk -
r44493:fa808e65 default
parent child Browse files
Show More
This diff has been collapsed as it changes many lines, (927 lines changed) Show them Hide them
@@ -1,1656 +1,733 b''
1 $ cat >> $HGRCPATH <<EOF
2 > [extdiff]
3 > # for portability:
4 > pdiff = sh "$RUNTESTDIR/pdiff"
5 > EOF
6
1
7 Create a repo with some stuff in it:
8
9 $ hg init a
10 $ cd a
11 $ echo a > a
12 $ echo a > d
13 $ echo a > e
14 $ hg ci -qAm0
15 $ echo b > a
16 $ hg ci -m1 -u bar
17 $ hg mv a b
18 $ hg ci -m2
19 $ hg cp b c
20 $ hg ci -m3 -u baz
21 $ echo b > d
22 $ echo f > e
23 $ hg ci -m4
24 $ hg up -q 3
25 $ echo b > e
26 $ hg branch -q stable
27 $ hg ci -m5
28 $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4
29 $ hg branch -q default
30 $ hg ci -m6
31 $ hg phase --public 3
32 $ hg phase --force --secret 6
33
34 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
35 @ test@6.secret: 6
36 |\
37 | o test@5.draft: 5
38 | |
39 o | test@4.draft: 4
40 |/
41 o baz@3.public: 3
42 |
43 o test@2.public: 2
44 |
45 o bar@1.public: 1
46 |
47 o test@0.public: 0
48
49 Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d
50
51 $ hg up -cqr 3
52 $ hg graft -r 6 --base 5
53 grafting 6:25a2b029d3ae "6" (tip)
54 merging e
55 $ hg st --change .
56 M d
57
58 $ hg -q strip . --config extensions.strip=
59
60 Test --base for collapsing changesets 2 and 3, thus getting both b and c
61
62 $ hg up -cqr 0
63 $ hg graft -r 3 --base 1
64 grafting 3:4c60f11aa304 "3"
65 merging a and b to b
66 merging a and c to c
67 $ hg st --change .
68 A b
69 A c
70 R a
71
72 $ hg -q strip . --config extensions.strip=
73
74 Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent)
75
76 $ hg graft -r 2 --base 3
77 grafting 2:5c095ad7e90f "2"
78 note: possible conflict - c was deleted and renamed to:
79 a
80 note: graft of 2:5c095ad7e90f created no changes to commit
81
82 Can't continue without starting:
83
84 $ hg -q up -cr tip
85 $ hg rm -q e
86 $ hg graft --continue
87 abort: no graft in progress
88 [255]
89 $ hg revert -r . -q e
90
91 Need to specify a rev:
92
93 $ hg graft
94 abort: no revisions specified
95 [255]
96
97 Can't graft ancestor:
98
99 $ hg graft 1 2
100 skipping ancestor revision 1:5d205f8b35b6
101 skipping ancestor revision 2:5c095ad7e90f
102 [255]
103
104 Specify revisions with -r:
105
106 $ hg graft -r 1 -r 2
107 skipping ancestor revision 1:5d205f8b35b6
108 skipping ancestor revision 2:5c095ad7e90f
109 [255]
110
111 $ hg graft -r 1 2
112 warning: inconsistent use of --rev might give unexpected revision ordering!
113 skipping ancestor revision 2:5c095ad7e90f
114 skipping ancestor revision 1:5d205f8b35b6
115 [255]
116
117 Conflicting date/user options:
118
119 $ hg up -q 0
120 $ hg graft -U --user foo 2
121 abort: cannot specify both --user and --currentuser
122 [255]
123 $ hg graft -D --date '0 0' 2
124 abort: cannot specify both --date and --currentdate
125 [255]
126
127 Can't graft with dirty wd:
128
129 $ hg up -q 0
130 $ echo foo > a
131 $ hg graft 1
132 abort: uncommitted changes
133 [255]
134 $ hg revert a
135
136 Graft a rename:
137 (this also tests that editor is invoked if '--edit' is specified)
138
139 $ hg status --rev "2^1" --rev 2
140 A b
141 R a
142 $ HGEDITOR=cat hg graft 2 -u foo --edit
143 grafting 2:5c095ad7e90f "2"
144 merging a and b to b
145 2
146
147
148 HG: Enter commit message. Lines beginning with 'HG:' are removed.
149 HG: Leave message empty to abort commit.
150 HG: --
151 HG: user: foo
152 HG: branch 'default'
153 HG: added b
154 HG: removed a
155 $ hg export tip --git
156 # HG changeset patch
157 # User foo
158 # Date 0 0
159 # Thu Jan 01 00:00:00 1970 +0000
160 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
161 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
162 2
163
164 diff --git a/a b/b
165 rename from a
166 rename to b
167
168 Look for extra:source
169
170 $ hg log --debug -r tip
171 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
172 tag: tip
173 phase: draft
174 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
175 parent: -1:0000000000000000000000000000000000000000
176 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
177 user: foo
178 date: Thu Jan 01 00:00:00 1970 +0000
179 files+: b
180 files-: a
181 extra: branch=default
182 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
183 description:
184 2
185
186
187
188 Graft out of order, skipping a merge and a duplicate
189 (this also tests that editor is not invoked if '--edit' is not specified)
190
191 $ hg graft 1 5 4 3 'merge()' 2 -n
192 skipping ungraftable merge revision 6
193 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
194 grafting 1:5d205f8b35b6 "1"
195 grafting 5:97f8bfe72746 "5"
196 grafting 4:9c233e8e184d "4"
197 grafting 3:4c60f11aa304 "3"
198
199 $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
200 skipping ungraftable merge revision 6
201 scanning for duplicate grafts
202 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
203 grafting 1:5d205f8b35b6 "1"
204 unmatched files in local:
205 b
206 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
207 src: 'a' -> dst: 'b' *
208 checking for directory renames
209 resolving manifests
210 branchmerge: True, force: True, partial: False
211 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
212 preserving b for resolve of b
213 starting 4 threads for background file closing (?)
214 b: local copied/moved from a -> m (premerge)
215 picked tool ':merge' for b (binary False symlink False changedelete False)
216 merging b and a to b
217 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
218 premerge successful
219 committing files:
220 b
221 committing manifest
222 committing changelog
223 updating the branch cache
224 grafting 5:97f8bfe72746 "5"
225 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
226 src: 'c' -> dst: 'b'
227 checking for directory renames
228 resolving manifests
229 branchmerge: True, force: True, partial: False
230 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
231 e: remote is newer -> g
232 getting e
233 committing files:
234 e
235 committing manifest
236 committing changelog
237 updating the branch cache
238 $ HGEDITOR=cat hg graft 4 3 --log --debug
239 scanning for duplicate grafts
240 grafting 4:9c233e8e184d "4"
241 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
242 src: 'c' -> dst: 'b'
243 checking for directory renames
244 resolving manifests
245 branchmerge: True, force: True, partial: False
246 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
247 preserving e for resolve of e
248 d: remote is newer -> g
249 getting d
250 e: versions differ -> m (premerge)
251 picked tool ':merge' for e (binary False symlink False changedelete False)
252 merging e
253 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
254 e: versions differ -> m (merge)
255 picked tool ':merge' for e (binary False symlink False changedelete False)
256 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
257 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
258 abort: unresolved conflicts, can't continue
259 (use 'hg resolve' and 'hg graft --continue')
260 [255]
261
262 Summary should mention graft:
263
264 $ hg summary |grep graft
265 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
266
267 Using status to get more context
268
269 $ hg status --verbose
270 M d
271 M e
272 ? a.orig
273 ? e.orig
274 # The repository is in an unfinished *graft* state.
275
276 # Unresolved merge conflicts:
277 #
278 # e
279 #
280 # To mark files as resolved: hg resolve --mark FILE
281
282 # To continue: hg graft --continue
283 # To abort: hg graft --abort
284 # To stop: hg graft --stop
285
286
287 Commit while interrupted should fail:
288
289 $ hg ci -m 'commit interrupted graft'
290 abort: graft in progress
291 (use 'hg graft --continue' or 'hg graft --stop' to stop)
292 [255]
293
294 Abort the graft and try committing:
295
296 $ hg up -C .
297 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 $ echo c >> e
299 $ hg ci -mtest
300
301 $ hg strip . --config extensions.strip=
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
303 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
304
305 Graft again:
306
307 $ hg graft 1 5 4 3 'merge()' 2
308 skipping ungraftable merge revision 6
309 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
310 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
311 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
312 grafting 4:9c233e8e184d "4"
313 merging e
314 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
315 abort: unresolved conflicts, can't continue
316 (use 'hg resolve' and 'hg graft --continue')
317 [255]
318
319 Continue without resolve should fail:
320
321 $ hg graft -c
322 grafting 4:9c233e8e184d "4"
323 abort: unresolved merge conflicts (see 'hg help resolve')
324 [255]
325
326 Fix up:
327
328 $ echo b > e
329 $ hg resolve -m e
330 (no more unresolved files)
331 continue: hg graft --continue
332
333 Continue with a revision should fail:
334
335 $ hg graft -c 6
336 abort: can't specify --continue and revisions
337 [255]
338
339 $ hg graft -c -r 6
340 abort: can't specify --continue and revisions
341 [255]
342
343 Continue for real, clobber usernames
344
345 $ hg graft -c -U
346 grafting 4:9c233e8e184d "4"
347 grafting 3:4c60f11aa304 "3"
348
349 Compare with original:
350
351 $ hg diff -r 6
352 $ hg status --rev 0:. -C
353 M d
354 M e
355 A b
356 a
357 A c
358 a
359 R a
360
361 View graph:
362
363 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
364 @ test@11.draft: 3
365 |
366 o test@10.draft: 4
367 |
368 o test@9.draft: 5
369 |
370 o bar@8.draft: 1
371 |
372 o foo@7.draft: 2
373 |
374 | o test@6.secret: 6
375 | |\
376 | | o test@5.draft: 5
377 | | |
378 | o | test@4.draft: 4
379 | |/
380 | o baz@3.public: 3
381 | |
382 | o test@2.public: 2
383 | |
384 | o bar@1.public: 1
385 |/
386 o test@0.public: 0
387
388 Graft again onto another branch should preserve the original source
389 $ hg up -q 0
390 $ echo 'g'>g
391 $ hg add g
392 $ hg ci -m 7
393 created new head
394 $ hg graft 7
395 grafting 7:ef0ef43d49e7 "2"
396
397 $ hg log -r 7 --template '{rev}:{node}\n'
398 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
399 $ hg log -r 2 --template '{rev}:{node}\n'
400 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
401
402 $ hg log --debug -r tip
403 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
404 tag: tip
405 phase: draft
406 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
407 parent: -1:0000000000000000000000000000000000000000
408 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
409 user: foo
410 date: Thu Jan 01 00:00:00 1970 +0000
411 files+: b
412 files-: a
413 extra: branch=default
414 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
415 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
416 description:
417 2
418
419
420 Disallow grafting an already grafted cset onto its original branch
421 $ hg up -q 6
422 $ hg graft 7
423 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
424 [255]
425
426 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
427 --- */hg-5c095ad7e90f.patch * (glob)
428 +++ */hg-7a4785234d87.patch * (glob)
429 @@ -1,18 +1,18 @@
430 # HG changeset patch
431 -# User test
432 +# User foo
433 # Date 0 0
434 # Thu Jan 01 00:00:00 1970 +0000
435 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
436 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
437 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
438 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
439 2
440
441 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
442 +diff -r b592ea63bb0c -r 7a4785234d87 a
443 --- a/a Thu Jan 01 00:00:00 1970 +0000
444 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
445 @@ -1,1 +0,0 @@
446 --b
447 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
448 +-a
449 +diff -r b592ea63bb0c -r 7a4785234d87 b
450 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
451 +++ b/b Thu Jan 01 00:00:00 1970 +0000
452 @@ -0,0 +1,1 @@
453 -+b
454 ++a
455 [1]
456
457 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
458 --- */hg-5c095ad7e90f.patch * (glob)
459 +++ */hg-7a4785234d87.patch * (glob)
460 @@ -1,8 +1,8 @@
461 # HG changeset patch
462 -# User test
463 +# User foo
464 # Date 0 0
465 # Thu Jan 01 00:00:00 1970 +0000
466 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
467 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
468 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
469 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
470 2
471
472 [1]
473
474 Disallow grafting already grafted csets with the same origin onto each other
475 $ hg up -q 13
476 $ hg graft 2
477 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
478 [255]
479 $ hg graft 7
480 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
481 [255]
482
483 $ hg up -q 7
484 $ hg graft 2
485 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
486 [255]
487 $ hg graft tip
488 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
489 [255]
490
491 Graft with --log
492
493 $ hg up -Cq 1
494 $ hg graft 3 --log -u foo
495 grafting 3:4c60f11aa304 "3"
496 warning: can't find ancestor for 'c' copied from 'b'!
497 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
498 14:0c921c65ef1e 1:5d205f8b35b6 3
499 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
500
501 Resolve conflicted graft
502 $ hg up -q 0
503 $ echo b > a
504 $ hg ci -m 8
505 created new head
506 $ echo c > a
507 $ hg ci -m 9
508 $ hg graft 1 --tool internal:fail
509 grafting 1:5d205f8b35b6 "1"
510 abort: unresolved conflicts, can't continue
511 (use 'hg resolve' and 'hg graft --continue')
512 [255]
513 $ hg resolve --all
514 merging a
515 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
516 [1]
517 $ cat a
518 <<<<<<< local: aaa4406d4f0a - test: 9
519 c
520 =======
521 b
522 >>>>>>> graft: 5d205f8b35b6 - bar: 1
523 $ echo b > a
524 $ hg resolve -m a
525 (no more unresolved files)
526 continue: hg graft --continue
527 $ hg graft -c
528 grafting 1:5d205f8b35b6 "1"
529 $ hg export tip --git
530 # HG changeset patch
531 # User bar
532 # Date 0 0
533 # Thu Jan 01 00:00:00 1970 +0000
534 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
535 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
536 1
537
538 diff --git a/a b/a
539 --- a/a
540 +++ b/a
541 @@ -1,1 +1,1 @@
542 -c
543 +b
544
545 Resolve conflicted graft with rename
546 $ echo c > a
547 $ hg ci -m 10
548 $ hg graft 2 --tool internal:fail
549 grafting 2:5c095ad7e90f "2"
550 abort: unresolved conflicts, can't continue
551 (use 'hg resolve' and 'hg graft --continue')
552 [255]
553 $ hg resolve --all
554 merging a and b to b
555 (no more unresolved files)
556 continue: hg graft --continue
557 $ hg graft -c
558 grafting 2:5c095ad7e90f "2"
559 $ hg export tip --git
560 # HG changeset patch
561 # User test
562 # Date 0 0
563 # Thu Jan 01 00:00:00 1970 +0000
564 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
565 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
566 2
567
568 diff --git a/a b/b
569 rename from a
570 rename to b
571
572 Test simple origin(), with and without args
573 $ hg log -r 'origin()'
574 changeset: 1:5d205f8b35b6
575 user: bar
576 date: Thu Jan 01 00:00:00 1970 +0000
577 summary: 1
578
579 changeset: 2:5c095ad7e90f
580 user: test
581 date: Thu Jan 01 00:00:00 1970 +0000
582 summary: 2
583
584 changeset: 3:4c60f11aa304
585 user: baz
586 date: Thu Jan 01 00:00:00 1970 +0000
587 summary: 3
588
589 changeset: 4:9c233e8e184d
590 user: test
591 date: Thu Jan 01 00:00:00 1970 +0000
592 summary: 4
593
594 changeset: 5:97f8bfe72746
595 branch: stable
596 parent: 3:4c60f11aa304
597 user: test
598 date: Thu Jan 01 00:00:00 1970 +0000
599 summary: 5
600
601 $ hg log -r 'origin(7)'
602 changeset: 2:5c095ad7e90f
603 user: test
604 date: Thu Jan 01 00:00:00 1970 +0000
605 summary: 2
606
607 Now transplant a graft to test following through copies
608 $ hg up -q 0
609 $ hg branch -q dev
610 $ hg ci -qm "dev branch"
611 $ hg --config extensions.transplant= transplant -q 7
612 $ hg log -r 'origin(.)'
613 changeset: 2:5c095ad7e90f
614 user: test
615 date: Thu Jan 01 00:00:00 1970 +0000
616 summary: 2
617
618 Test that the graft and transplant markers in extra are converted, allowing
619 origin() to still work. Note that these recheck the immediately preceeding two
620 tests.
621 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
622
623 The graft case
624 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
625 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
626 branch=default
627 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
628 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
629 $ hg -R ../converted log -r 'origin(7)'
630 changeset: 2:e0213322b2c1
631 user: test
632 date: Thu Jan 01 00:00:00 1970 +0000
633 summary: 2
634
635 Test that template correctly expands more than one 'extra' (issue4362), and that
636 'intermediate-source' is converted.
637 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
638 Extra: branch=default
639 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
640 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
641 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
642
643 The transplant case
644 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
645 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
646 branch=dev
647 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
648 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
649 $ hg -R ../converted log -r 'origin(tip)'
650 changeset: 2:e0213322b2c1
651 user: test
652 date: Thu Jan 01 00:00:00 1970 +0000
653 summary: 2
654
655
656 Test simple destination
657 $ hg log -r 'destination()'
658 changeset: 7:ef0ef43d49e7
659 parent: 0:68795b066622
660 user: foo
661 date: Thu Jan 01 00:00:00 1970 +0000
662 summary: 2
663
664 changeset: 8:6b9e5368ca4e
665 user: bar
666 date: Thu Jan 01 00:00:00 1970 +0000
667 summary: 1
668
669 changeset: 9:1905859650ec
670 user: test
671 date: Thu Jan 01 00:00:00 1970 +0000
672 summary: 5
673
674 changeset: 10:52dc0b4c6907
675 user: test
676 date: Thu Jan 01 00:00:00 1970 +0000
677 summary: 4
678
679 changeset: 11:882b35362a6b
680 user: test
681 date: Thu Jan 01 00:00:00 1970 +0000
682 summary: 3
683
684 changeset: 13:7a4785234d87
685 user: foo
686 date: Thu Jan 01 00:00:00 1970 +0000
687 summary: 2
688
689 changeset: 14:0c921c65ef1e
690 parent: 1:5d205f8b35b6
691 user: foo
692 date: Thu Jan 01 00:00:00 1970 +0000
693 summary: 3
694
695 changeset: 17:f67661df0c48
696 user: bar
697 date: Thu Jan 01 00:00:00 1970 +0000
698 summary: 1
699
700 changeset: 19:9627f653b421
701 user: test
702 date: Thu Jan 01 00:00:00 1970 +0000
703 summary: 2
704
705 changeset: 21:7e61b508e709
706 branch: dev
707 tag: tip
708 user: foo
709 date: Thu Jan 01 00:00:00 1970 +0000
710 summary: 2
711
712 $ hg log -r 'destination(2)'
713 changeset: 7:ef0ef43d49e7
714 parent: 0:68795b066622
715 user: foo
716 date: Thu Jan 01 00:00:00 1970 +0000
717 summary: 2
718
719 changeset: 13:7a4785234d87
720 user: foo
721 date: Thu Jan 01 00:00:00 1970 +0000
722 summary: 2
723
724 changeset: 19:9627f653b421
725 user: test
726 date: Thu Jan 01 00:00:00 1970 +0000
727 summary: 2
728
729 changeset: 21:7e61b508e709
730 branch: dev
731 tag: tip
732 user: foo
733 date: Thu Jan 01 00:00:00 1970 +0000
734 summary: 2
735
736 Transplants of grafts can find a destination...
737 $ hg log -r 'destination(7)'
738 changeset: 21:7e61b508e709
739 branch: dev
740 tag: tip
741 user: foo
742 date: Thu Jan 01 00:00:00 1970 +0000
743 summary: 2
744
745 ... grafts of grafts unfortunately can't
746 $ hg graft -q 13 --debug
747 scanning for duplicate grafts
748 grafting 13:7a4785234d87 "2"
749 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
750 src: 'a' -> dst: 'b' *
751 checking for directory renames
752 resolving manifests
753 branchmerge: True, force: True, partial: False
754 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
755 starting 4 threads for background file closing (?)
756 committing files:
757 b
758 warning: can't find ancestor for 'b' copied from 'a'!
759 reusing manifest from p1 (listed files actually unchanged)
760 committing changelog
761 updating the branch cache
762 $ hg log -r 'destination(13)'
763 All copies of a cset
764 $ hg log -r 'origin(13) or destination(origin(13))'
765 changeset: 2:5c095ad7e90f
766 user: test
767 date: Thu Jan 01 00:00:00 1970 +0000
768 summary: 2
769
770 changeset: 7:ef0ef43d49e7
771 parent: 0:68795b066622
772 user: foo
773 date: Thu Jan 01 00:00:00 1970 +0000
774 summary: 2
775
776 changeset: 13:7a4785234d87
777 user: foo
778 date: Thu Jan 01 00:00:00 1970 +0000
779 summary: 2
780
781 changeset: 19:9627f653b421
782 user: test
783 date: Thu Jan 01 00:00:00 1970 +0000
784 summary: 2
785
786 changeset: 21:7e61b508e709
787 branch: dev
788 user: foo
789 date: Thu Jan 01 00:00:00 1970 +0000
790 summary: 2
791
792 changeset: 22:3a4e92d81b97
793 branch: dev
794 tag: tip
795 user: foo
796 date: Thu Jan 01 00:00:00 1970 +0000
797 summary: 2
798
799
800 graft works on complex revset
801
802 $ hg graft 'origin(13) or destination(origin(13))'
803 skipping ancestor revision 21:7e61b508e709
804 skipping ancestor revision 22:3a4e92d81b97
805 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
806 grafting 7:ef0ef43d49e7 "2"
807 warning: can't find ancestor for 'b' copied from 'a'!
808 grafting 13:7a4785234d87 "2"
809 warning: can't find ancestor for 'b' copied from 'a'!
810 grafting 19:9627f653b421 "2"
811 merging b
812 warning: can't find ancestor for 'b' copied from 'a'!
813
814 graft with --force (still doesn't graft merges)
815
816 $ hg graft 19 0 6
817 skipping ungraftable merge revision 6
818 skipping ancestor revision 0:68795b066622
819 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
820 [255]
821 $ hg graft 19 0 6 --force
822 skipping ungraftable merge revision 6
823 grafting 19:9627f653b421 "2"
824 merging b
825 warning: can't find ancestor for 'b' copied from 'a'!
826 grafting 0:68795b066622 "0"
827
828 graft --force after backout
829
830 $ echo abc > a
831 $ hg ci -m 28
832 $ hg backout 28
833 reverting a
834 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
835 $ hg graft 28
836 skipping ancestor revision 28:cc20d29aec8d
837 [255]
838 $ hg graft 28 --force
839 grafting 28:cc20d29aec8d "28"
840 merging a
841 $ cat a
842 abc
843
844 graft --continue after --force
845
846 $ echo def > a
847 $ hg ci -m 31
848 $ hg graft 28 --force --tool internal:fail
849 grafting 28:cc20d29aec8d "28"
850 abort: unresolved conflicts, can't continue
851 (use 'hg resolve' and 'hg graft --continue')
852 [255]
853 $ hg resolve --all
854 merging a
855 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
856 [1]
857 $ echo abc > a
858 $ hg resolve -m a
859 (no more unresolved files)
860 continue: hg graft --continue
861 $ hg graft -c
862 grafting 28:cc20d29aec8d "28"
863 $ cat a
864 abc
865
866 Continue testing same origin policy, using revision numbers from test above
867 but do some destructive editing of the repo:
868
869 $ hg up -qC 7
870 $ hg tag -l -r 13 tmp
871 $ hg --config extensions.strip= strip 2
872 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
873 $ hg graft tmp
874 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
875 [255]
876
877 Empty graft
878
879 $ hg up -qr 26
880 $ hg tag -f something
881 $ hg graft -qr 27
882 $ hg graft -f 27
883 grafting 27:17d42b8f5d50 "28"
884 note: graft of 27:17d42b8f5d50 created no changes to commit
885
886 $ cd ..
887
888 Graft to duplicate a commit
889
890 $ hg init graftsibling
891 $ cd graftsibling
892 $ touch a
893 $ hg commit -qAm a
894 $ touch b
895 $ hg commit -qAm b
896 $ hg log -G -T '{rev}\n'
897 @ 1
898 |
899 o 0
900
901 $ hg up -q 0
902 $ hg graft -r 1
903 grafting 1:0e067c57feba "b" (tip)
904 $ hg log -G -T '{rev}\n'
905 @ 2
906 |
907 | o 1
908 |/
909 o 0
910
911 Graft to duplicate a commit twice
912
913 $ hg up -q 0
914 $ hg graft -r 2
915 grafting 2:044ec77f6389 "b" (tip)
916 $ hg log -G -T '{rev}\n'
917 @ 3
918 |
919 | o 2
920 |/
921 | o 1
922 |/
923 o 0
924
925 Graft from behind a move or rename
2 Graft from behind a move or rename
926 ==================================
3 ==================================
927
4
928 NOTE: This is affected by issue5343, and will need updating when it's fixed
5 NOTE: This is affected by issue5343, and will need updating when it's fixed
929
6
930 Consider this topology for a regular graft:
7 Consider this topology for a regular graft:
931
8
932 o c1
9 o c1
933 |
10 |
934 | o c2
11 | o c2
935 | |
12 | |
936 | o ca # stands for "common ancestor"
13 | o ca # stands for "common ancestor"
937 |/
14 |/
938 o cta # stands for "common topological ancestor"
15 o cta # stands for "common topological ancestor"
939
16
940 Note that in issue5343, ca==cta.
17 Note that in issue5343, ca==cta.
941
18
942 The following table shows the possible cases. Here, "x->y" and, equivalently,
19 The following table shows the possible cases. Here, "x->y" and, equivalently,
943 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
20 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
944
21
945 name | c1<-cta | cta<->ca | ca->c2
22 name | c1<-cta | cta<->ca | ca->c2
946 A.0 | | |
23 A.0 | | |
947 A.1 | X | |
24 A.1 | X | |
948 A.2 | | X |
25 A.2 | | X |
949 A.3 | | | X
26 A.3 | | | X
950 A.4 | X | X |
27 A.4 | X | X |
951 A.5 | X | | X
28 A.5 | X | | X
952 A.6 | | X | X
29 A.6 | | X | X
953 A.7 | X | X | X
30 A.7 | X | X | X
954
31
955 A.0 is trivial, and doesn't need copy tracking.
32 A.0 is trivial, and doesn't need copy tracking.
956 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
33 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
957 In A.2, the rename is recorded in the c2 pass and followed backwards.
34 In A.2, the rename is recorded in the c2 pass and followed backwards.
958 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
35 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
959 In A.4, both passes of checkcopies record incomplete renames, which are
36 In A.4, both passes of checkcopies record incomplete renames, which are
960 then joined in mergecopies to record a rename to be followed.
37 then joined in mergecopies to record a rename to be followed.
961 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
38 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
962 records an incomplete divergence. The incomplete rename is then joined to the
39 records an incomplete divergence. The incomplete rename is then joined to the
963 appropriate side of the incomplete divergence, and the result is recorded as a
40 appropriate side of the incomplete divergence, and the result is recorded as a
964 divergence. The code doesn't distinguish at all between these two cases, since
41 divergence. The code doesn't distinguish at all between these two cases, since
965 the end result of them is the same: an incomplete divergence joined with an
42 the end result of them is the same: an incomplete divergence joined with an
966 incomplete rename into a divergence.
43 incomplete rename into a divergence.
967 Finally, A.6 records a divergence entirely in the c2 pass.
44 Finally, A.6 records a divergence entirely in the c2 pass.
968
45
969 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
46 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
970 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
47 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
971 A.5 has issue5343 as a special case.
48 A.5 has issue5343 as a special case.
972 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
49 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
973 incomplete divergence, which is in fact complete. This is handled later in
50 incomplete divergence, which is in fact complete. This is handled later in
974 mergecopies.
51 mergecopies.
975 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
52 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
976 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
53 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
977 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
54 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
978 case, a<-b<-c->a is treated the same as a<-b<-b->a).
55 case, a<-b<-c->a is treated the same as a<-b<-b->a).
979
56
980 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
57 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
981 same name on both branches, then the rename is backed out on one branch, and
58 same name on both branches, then the rename is backed out on one branch, and
982 the backout is grafted to the other branch. This creates a challenging rename
59 the backout is grafted to the other branch. This creates a challenging rename
983 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
60 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
984 source, respectively. Since rename detection will run on the c1 side for such a
61 source, respectively. Since rename detection will run on the c1 side for such a
985 sequence (as for technical reasons, we split the c1 and c2 sides not at the
62 sequence (as for technical reasons, we split the c1 and c2 sides not at the
986 graft CA, but rather at the topological CA), it will pick up a false rename,
63 graft CA, but rather at the topological CA), it will pick up a false rename,
987 and cause a spurious merge conflict. This false rename is always exactly the
64 and cause a spurious merge conflict. This false rename is always exactly the
988 reverse of the true rename that would be detected on the c2 side, so we can
65 reverse of the true rename that would be detected on the c2 side, so we can
989 correct for it by detecting this condition and reversing as necessary.
66 correct for it by detecting this condition and reversing as necessary.
990
67
991 First, set up the repository with commits to be grafted
68 First, set up the repository with commits to be grafted
992
69
993 $ hg init ../graftmove
70 $ hg init graftmove
994 $ cd ../graftmove
71 $ cd graftmove
995 $ echo c1a > f1a
72 $ echo c1a > f1a
996 $ echo c2a > f2a
73 $ echo c2a > f2a
997 $ echo c3a > f3a
74 $ echo c3a > f3a
998 $ echo c4a > f4a
75 $ echo c4a > f4a
999 $ echo c5a > f5a
76 $ echo c5a > f5a
1000 $ hg ci -qAm A0
77 $ hg ci -qAm A0
1001 $ hg mv f1a f1b
78 $ hg mv f1a f1b
1002 $ hg mv f3a f3b
79 $ hg mv f3a f3b
1003 $ hg mv f5a f5b
80 $ hg mv f5a f5b
1004 $ hg ci -qAm B0
81 $ hg ci -qAm B0
1005 $ echo c1c > f1b
82 $ echo c1c > f1b
1006 $ hg mv f2a f2c
83 $ hg mv f2a f2c
1007 $ hg mv f5b f5a
84 $ hg mv f5b f5a
1008 $ echo c5c > f5a
85 $ echo c5c > f5a
1009 $ hg ci -qAm C0
86 $ hg ci -qAm C0
1010 $ hg mv f3b f3d
87 $ hg mv f3b f3d
1011 $ echo c4d > f4a
88 $ echo c4d > f4a
1012 $ hg ci -qAm D0
89 $ hg ci -qAm D0
1013 $ hg log -G
90 $ hg log -G
1014 @ changeset: 3:b69f5839d2d9
91 @ changeset: 3:b69f5839d2d9
1015 | tag: tip
92 | tag: tip
1016 | user: test
93 | user: test
1017 | date: Thu Jan 01 00:00:00 1970 +0000
94 | date: Thu Jan 01 00:00:00 1970 +0000
1018 | summary: D0
95 | summary: D0
1019 |
96 |
1020 o changeset: 2:f58c7e2b28fa
97 o changeset: 2:f58c7e2b28fa
1021 | user: test
98 | user: test
1022 | date: Thu Jan 01 00:00:00 1970 +0000
99 | date: Thu Jan 01 00:00:00 1970 +0000
1023 | summary: C0
100 | summary: C0
1024 |
101 |
1025 o changeset: 1:3d7bba921b5d
102 o changeset: 1:3d7bba921b5d
1026 | user: test
103 | user: test
1027 | date: Thu Jan 01 00:00:00 1970 +0000
104 | date: Thu Jan 01 00:00:00 1970 +0000
1028 | summary: B0
105 | summary: B0
1029 |
106 |
1030 o changeset: 0:11f7a1b56675
107 o changeset: 0:11f7a1b56675
1031 user: test
108 user: test
1032 date: Thu Jan 01 00:00:00 1970 +0000
109 date: Thu Jan 01 00:00:00 1970 +0000
1033 summary: A0
110 summary: A0
1034
111
1035
112
1036 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
113 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1037 two renames actually converge to the same name (thus no actual divergence).
114 two renames actually converge to the same name (thus no actual divergence).
1038
115
1039 $ hg up -q 'desc("A0")'
116 $ hg up -q 'desc("A0")'
1040 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
117 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1041 grafting 2:f58c7e2b28fa "C0"
118 grafting 2:f58c7e2b28fa "C0"
1042 merging f1a and f1b to f1a
119 merging f1a and f1b to f1a
1043 merging f5a
120 merging f5a
1044 warning: can't find ancestor for 'f5a' copied from 'f5b'!
121 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1045 $ hg status --change .
122 $ hg status --change .
1046 M f1a
123 M f1a
1047 M f5a
124 M f5a
1048 A f2c
125 A f2c
1049 R f2a
126 R f2a
1050 $ hg cat f1a
127 $ hg cat f1a
1051 c1c
128 c1c
1052 $ hg cat f1b
129 $ hg cat f1b
1053 f1b: no such file in rev c9763722f9bd
130 f1b: no such file in rev c9763722f9bd
1054 [1]
131 [1]
1055
132
1056 Test the cases A.0 (f4x) and A.6 (f3x)
133 Test the cases A.0 (f4x) and A.6 (f3x)
1057
134
1058 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
135 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1059 grafting 3:b69f5839d2d9 "D0"
136 grafting 3:b69f5839d2d9 "D0"
1060 note: possible conflict - f3b was renamed multiple times to:
137 note: possible conflict - f3b was renamed multiple times to:
1061 f3a
138 f3a
1062 f3d
139 f3d
1063 warning: can't find ancestor for 'f3d' copied from 'f3b'!
140 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1064
141
1065 Set up the repository for some further tests
142 Set up the repository for some further tests
1066
143
1067 $ hg up -q "min(desc("A0"))"
144 $ hg up -q "min(desc("A0"))"
1068 $ hg mv f1a f1e
145 $ hg mv f1a f1e
1069 $ echo c2e > f2a
146 $ echo c2e > f2a
1070 $ hg mv f3a f3e
147 $ hg mv f3a f3e
1071 $ hg mv f4a f4e
148 $ hg mv f4a f4e
1072 $ hg mv f5a f5b
149 $ hg mv f5a f5b
1073 $ hg ci -qAm "E0"
150 $ hg ci -qAm "E0"
1074 $ hg up -q "min(desc("A0"))"
151 $ hg up -q "min(desc("A0"))"
1075 $ hg cp f1a f1f
152 $ hg cp f1a f1f
1076 $ hg ci -qAm "F0"
153 $ hg ci -qAm "F0"
1077 $ hg up -q "min(desc("A0"))"
154 $ hg up -q "min(desc("A0"))"
1078 $ hg cp f1a f1g
155 $ hg cp f1a f1g
1079 $ echo c1g > f1g
156 $ echo c1g > f1g
1080 $ hg ci -qAm "G0"
157 $ hg ci -qAm "G0"
1081 $ hg log -G
158 $ hg log -G
1082 @ changeset: 8:ba67f08fb15a
159 @ changeset: 8:ba67f08fb15a
1083 | tag: tip
160 | tag: tip
1084 | parent: 0:11f7a1b56675
161 | parent: 0:11f7a1b56675
1085 | user: test
162 | user: test
1086 | date: Thu Jan 01 00:00:00 1970 +0000
163 | date: Thu Jan 01 00:00:00 1970 +0000
1087 | summary: G0
164 | summary: G0
1088 |
165 |
1089 | o changeset: 7:d376ab0d7fda
166 | o changeset: 7:d376ab0d7fda
1090 |/ parent: 0:11f7a1b56675
167 |/ parent: 0:11f7a1b56675
1091 | user: test
168 | user: test
1092 | date: Thu Jan 01 00:00:00 1970 +0000
169 | date: Thu Jan 01 00:00:00 1970 +0000
1093 | summary: F0
170 | summary: F0
1094 |
171 |
1095 | o changeset: 6:6bd1736cab86
172 | o changeset: 6:6bd1736cab86
1096 |/ parent: 0:11f7a1b56675
173 |/ parent: 0:11f7a1b56675
1097 | user: test
174 | user: test
1098 | date: Thu Jan 01 00:00:00 1970 +0000
175 | date: Thu Jan 01 00:00:00 1970 +0000
1099 | summary: E0
176 | summary: E0
1100 |
177 |
1101 | o changeset: 5:560daee679da
178 | o changeset: 5:560daee679da
1102 | | user: test
179 | | user: test
1103 | | date: Thu Jan 01 00:00:00 1970 +0000
180 | | date: Thu Jan 01 00:00:00 1970 +0000
1104 | | summary: D1
181 | | summary: D1
1105 | |
182 | |
1106 | o changeset: 4:c9763722f9bd
183 | o changeset: 4:c9763722f9bd
1107 |/ parent: 0:11f7a1b56675
184 |/ parent: 0:11f7a1b56675
1108 | user: test
185 | user: test
1109 | date: Thu Jan 01 00:00:00 1970 +0000
186 | date: Thu Jan 01 00:00:00 1970 +0000
1110 | summary: C1
187 | summary: C1
1111 |
188 |
1112 | o changeset: 3:b69f5839d2d9
189 | o changeset: 3:b69f5839d2d9
1113 | | user: test
190 | | user: test
1114 | | date: Thu Jan 01 00:00:00 1970 +0000
191 | | date: Thu Jan 01 00:00:00 1970 +0000
1115 | | summary: D0
192 | | summary: D0
1116 | |
193 | |
1117 | o changeset: 2:f58c7e2b28fa
194 | o changeset: 2:f58c7e2b28fa
1118 | | user: test
195 | | user: test
1119 | | date: Thu Jan 01 00:00:00 1970 +0000
196 | | date: Thu Jan 01 00:00:00 1970 +0000
1120 | | summary: C0
197 | | summary: C0
1121 | |
198 | |
1122 | o changeset: 1:3d7bba921b5d
199 | o changeset: 1:3d7bba921b5d
1123 |/ user: test
200 |/ user: test
1124 | date: Thu Jan 01 00:00:00 1970 +0000
201 | date: Thu Jan 01 00:00:00 1970 +0000
1125 | summary: B0
202 | summary: B0
1126 |
203 |
1127 o changeset: 0:11f7a1b56675
204 o changeset: 0:11f7a1b56675
1128 user: test
205 user: test
1129 date: Thu Jan 01 00:00:00 1970 +0000
206 date: Thu Jan 01 00:00:00 1970 +0000
1130 summary: A0
207 summary: A0
1131
208
1132
209
1133 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
210 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1134 and A.3 with a local content change to be preserved (f2x).
211 and A.3 with a local content change to be preserved (f2x).
1135
212
1136 $ hg up -q "desc("E0")"
213 $ hg up -q "desc("E0")"
1137 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
214 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1138 grafting 2:f58c7e2b28fa "C0"
215 grafting 2:f58c7e2b28fa "C0"
1139 merging f1e and f1b to f1e
216 merging f1e and f1b to f1e
1140 merging f2a and f2c to f2c
217 merging f2a and f2c to f2c
1141
218
1142 Test the cases A.1 (f4x) and A.7 (f3x).
219 Test the cases A.1 (f4x) and A.7 (f3x).
1143
220
1144 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
221 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1145 grafting 3:b69f5839d2d9 "D0"
222 grafting 3:b69f5839d2d9 "D0"
1146 note: possible conflict - f3b was renamed multiple times to:
223 note: possible conflict - f3b was renamed multiple times to:
1147 f3d
224 f3d
1148 f3e
225 f3e
1149 merging f4e and f4a to f4e
226 merging f4e and f4a to f4e
1150 warning: can't find ancestor for 'f3d' copied from 'f3b'!
227 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1151
228
1152 $ hg cat f2c
229 $ hg cat f2c
1153 c2e
230 c2e
1154
231
1155 Test the case A.5 (move case, f1x).
232 Test the case A.5 (move case, f1x).
1156
233
1157 $ hg up -q "desc("C0")"
234 $ hg up -q "desc("C0")"
1158 BROKEN: Shouldn't get the warning about missing ancestor
235 BROKEN: Shouldn't get the warning about missing ancestor
1159 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
236 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
1160 grafting 6:6bd1736cab86 "E0"
237 grafting 6:6bd1736cab86 "E0"
1161 note: possible conflict - f1a was renamed multiple times to:
238 note: possible conflict - f1a was renamed multiple times to:
1162 f1b
239 f1b
1163 f1e
240 f1e
1164 note: possible conflict - f3a was renamed multiple times to:
241 note: possible conflict - f3a was renamed multiple times to:
1165 f3b
242 f3b
1166 f3e
243 f3e
1167 merging f2c and f2a to f2c
244 merging f2c and f2a to f2c
1168 merging f5a and f5b to f5b
245 merging f5a and f5b to f5b
1169 warning: can't find ancestor for 'f1e' copied from 'f1a'!
246 warning: can't find ancestor for 'f1e' copied from 'f1a'!
1170 warning: can't find ancestor for 'f3e' copied from 'f3a'!
247 warning: can't find ancestor for 'f3e' copied from 'f3a'!
1171 $ cat f1e
248 $ cat f1e
1172 c1a
249 c1a
1173
250
1174 Test the case A.5 (copy case, f1x).
251 Test the case A.5 (copy case, f1x).
1175
252
1176 $ hg up -q "desc("C0")"
253 $ hg up -q "desc("C0")"
1177 BROKEN: Shouldn't get the warning about missing ancestor
254 BROKEN: Shouldn't get the warning about missing ancestor
1178 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
255 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
1179 grafting 7:d376ab0d7fda "F0"
256 grafting 7:d376ab0d7fda "F0"
1180 warning: can't find ancestor for 'f1f' copied from 'f1a'!
257 warning: can't find ancestor for 'f1f' copied from 'f1a'!
1181 BROKEN: f1f should be marked a copy from f1b
258 BROKEN: f1f should be marked a copy from f1b
1182 $ hg st --copies --change .
259 $ hg st --copies --change .
1183 A f1f
260 A f1f
1184 BROKEN: f1f should have the new content from f1b (i.e. "c1c")
261 BROKEN: f1f should have the new content from f1b (i.e. "c1c")
1185 $ cat f1f
262 $ cat f1f
1186 c1a
263 c1a
1187
264
1188 Test the case A.5 (copy+modify case, f1x).
265 Test the case A.5 (copy+modify case, f1x).
1189
266
1190 $ hg up -q "desc("C0")"
267 $ hg up -q "desc("C0")"
1191 BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
268 BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
1192 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
269 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
1193 "c1a")
270 "c1a")
1194 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
271 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
1195 grafting 8:ba67f08fb15a "G0"
272 grafting 8:ba67f08fb15a "G0"
1196 warning: can't find ancestor for 'f1g' copied from 'f1a'!
273 warning: can't find ancestor for 'f1g' copied from 'f1a'!
1197
274
1198 Check the results of the grafts tested
275 Check the results of the grafts tested
1199
276
1200 $ hg log -CGv --patch --git
277 $ hg log -CGv --patch --git
1201 @ changeset: 13:ef3adf6c20a4
278 @ changeset: 13:ef3adf6c20a4
1202 | tag: tip
279 | tag: tip
1203 | parent: 2:f58c7e2b28fa
280 | parent: 2:f58c7e2b28fa
1204 | user: test
281 | user: test
1205 | date: Thu Jan 01 00:00:00 1970 +0000
282 | date: Thu Jan 01 00:00:00 1970 +0000
1206 | files: f1g
283 | files: f1g
1207 | description:
284 | description:
1208 | G1
285 | G1
1209 |
286 |
1210 |
287 |
1211 | diff --git a/f1g b/f1g
288 | diff --git a/f1g b/f1g
1212 | new file mode 100644
289 | new file mode 100644
1213 | --- /dev/null
290 | --- /dev/null
1214 | +++ b/f1g
291 | +++ b/f1g
1215 | @@ -0,0 +1,1 @@
292 | @@ -0,0 +1,1 @@
1216 | +c1g
293 | +c1g
1217 |
294 |
1218 | o changeset: 12:b5542d755b54
295 | o changeset: 12:b5542d755b54
1219 |/ parent: 2:f58c7e2b28fa
296 |/ parent: 2:f58c7e2b28fa
1220 | user: test
297 | user: test
1221 | date: Thu Jan 01 00:00:00 1970 +0000
298 | date: Thu Jan 01 00:00:00 1970 +0000
1222 | files: f1f
299 | files: f1f
1223 | description:
300 | description:
1224 | F1
301 | F1
1225 |
302 |
1226 |
303 |
1227 | diff --git a/f1f b/f1f
304 | diff --git a/f1f b/f1f
1228 | new file mode 100644
305 | new file mode 100644
1229 | --- /dev/null
306 | --- /dev/null
1230 | +++ b/f1f
307 | +++ b/f1f
1231 | @@ -0,0 +1,1 @@
308 | @@ -0,0 +1,1 @@
1232 | +c1a
309 | +c1a
1233 |
310 |
1234 | o changeset: 11:f8a162271246
311 | o changeset: 11:f8a162271246
1235 |/ parent: 2:f58c7e2b28fa
312 |/ parent: 2:f58c7e2b28fa
1236 | user: test
313 | user: test
1237 | date: Thu Jan 01 00:00:00 1970 +0000
314 | date: Thu Jan 01 00:00:00 1970 +0000
1238 | files: f1e f2c f3e f4a f4e f5a f5b
315 | files: f1e f2c f3e f4a f4e f5a f5b
1239 | copies: f4e (f4a) f5b (f5a)
316 | copies: f4e (f4a) f5b (f5a)
1240 | description:
317 | description:
1241 | E1
318 | E1
1242 |
319 |
1243 |
320 |
1244 | diff --git a/f1e b/f1e
321 | diff --git a/f1e b/f1e
1245 | new file mode 100644
322 | new file mode 100644
1246 | --- /dev/null
323 | --- /dev/null
1247 | +++ b/f1e
324 | +++ b/f1e
1248 | @@ -0,0 +1,1 @@
325 | @@ -0,0 +1,1 @@
1249 | +c1a
326 | +c1a
1250 | diff --git a/f2c b/f2c
327 | diff --git a/f2c b/f2c
1251 | --- a/f2c
328 | --- a/f2c
1252 | +++ b/f2c
329 | +++ b/f2c
1253 | @@ -1,1 +1,1 @@
330 | @@ -1,1 +1,1 @@
1254 | -c2a
331 | -c2a
1255 | +c2e
332 | +c2e
1256 | diff --git a/f3e b/f3e
333 | diff --git a/f3e b/f3e
1257 | new file mode 100644
334 | new file mode 100644
1258 | --- /dev/null
335 | --- /dev/null
1259 | +++ b/f3e
336 | +++ b/f3e
1260 | @@ -0,0 +1,1 @@
337 | @@ -0,0 +1,1 @@
1261 | +c3a
338 | +c3a
1262 | diff --git a/f4a b/f4e
339 | diff --git a/f4a b/f4e
1263 | rename from f4a
340 | rename from f4a
1264 | rename to f4e
341 | rename to f4e
1265 | diff --git a/f5a b/f5b
342 | diff --git a/f5a b/f5b
1266 | rename from f5a
343 | rename from f5a
1267 | rename to f5b
344 | rename to f5b
1268 |
345 |
1269 | o changeset: 10:93ee502e8b0a
346 | o changeset: 10:93ee502e8b0a
1270 | | user: test
347 | | user: test
1271 | | date: Thu Jan 01 00:00:00 1970 +0000
348 | | date: Thu Jan 01 00:00:00 1970 +0000
1272 | | files: f3d f4e
349 | | files: f3d f4e
1273 | | description:
350 | | description:
1274 | | D2
351 | | D2
1275 | |
352 | |
1276 | |
353 | |
1277 | | diff --git a/f3d b/f3d
354 | | diff --git a/f3d b/f3d
1278 | | new file mode 100644
355 | | new file mode 100644
1279 | | --- /dev/null
356 | | --- /dev/null
1280 | | +++ b/f3d
357 | | +++ b/f3d
1281 | | @@ -0,0 +1,1 @@
358 | | @@ -0,0 +1,1 @@
1282 | | +c3a
359 | | +c3a
1283 | | diff --git a/f4e b/f4e
360 | | diff --git a/f4e b/f4e
1284 | | --- a/f4e
361 | | --- a/f4e
1285 | | +++ b/f4e
362 | | +++ b/f4e
1286 | | @@ -1,1 +1,1 @@
363 | | @@ -1,1 +1,1 @@
1287 | | -c4a
364 | | -c4a
1288 | | +c4d
365 | | +c4d
1289 | |
366 | |
1290 | o changeset: 9:539cf145f496
367 | o changeset: 9:539cf145f496
1291 | | parent: 6:6bd1736cab86
368 | | parent: 6:6bd1736cab86
1292 | | user: test
369 | | user: test
1293 | | date: Thu Jan 01 00:00:00 1970 +0000
370 | | date: Thu Jan 01 00:00:00 1970 +0000
1294 | | files: f1e f2a f2c f5a f5b
371 | | files: f1e f2a f2c f5a f5b
1295 | | copies: f2c (f2a) f5a (f5b)
372 | | copies: f2c (f2a) f5a (f5b)
1296 | | description:
373 | | description:
1297 | | C2
374 | | C2
1298 | |
375 | |
1299 | |
376 | |
1300 | | diff --git a/f1e b/f1e
377 | | diff --git a/f1e b/f1e
1301 | | --- a/f1e
378 | | --- a/f1e
1302 | | +++ b/f1e
379 | | +++ b/f1e
1303 | | @@ -1,1 +1,1 @@
380 | | @@ -1,1 +1,1 @@
1304 | | -c1a
381 | | -c1a
1305 | | +c1c
382 | | +c1c
1306 | | diff --git a/f2a b/f2c
383 | | diff --git a/f2a b/f2c
1307 | | rename from f2a
384 | | rename from f2a
1308 | | rename to f2c
385 | | rename to f2c
1309 | | diff --git a/f5b b/f5a
386 | | diff --git a/f5b b/f5a
1310 | | rename from f5b
387 | | rename from f5b
1311 | | rename to f5a
388 | | rename to f5a
1312 | | --- a/f5b
389 | | --- a/f5b
1313 | | +++ b/f5a
390 | | +++ b/f5a
1314 | | @@ -1,1 +1,1 @@
391 | | @@ -1,1 +1,1 @@
1315 | | -c5a
392 | | -c5a
1316 | | +c5c
393 | | +c5c
1317 | |
394 | |
1318 | | o changeset: 8:ba67f08fb15a
395 | | o changeset: 8:ba67f08fb15a
1319 | | | parent: 0:11f7a1b56675
396 | | | parent: 0:11f7a1b56675
1320 | | | user: test
397 | | | user: test
1321 | | | date: Thu Jan 01 00:00:00 1970 +0000
398 | | | date: Thu Jan 01 00:00:00 1970 +0000
1322 | | | files: f1g
399 | | | files: f1g
1323 | | | copies: f1g (f1a)
400 | | | copies: f1g (f1a)
1324 | | | description:
401 | | | description:
1325 | | | G0
402 | | | G0
1326 | | |
403 | | |
1327 | | |
404 | | |
1328 | | | diff --git a/f1a b/f1g
405 | | | diff --git a/f1a b/f1g
1329 | | | copy from f1a
406 | | | copy from f1a
1330 | | | copy to f1g
407 | | | copy to f1g
1331 | | | --- a/f1a
408 | | | --- a/f1a
1332 | | | +++ b/f1g
409 | | | +++ b/f1g
1333 | | | @@ -1,1 +1,1 @@
410 | | | @@ -1,1 +1,1 @@
1334 | | | -c1a
411 | | | -c1a
1335 | | | +c1g
412 | | | +c1g
1336 | | |
413 | | |
1337 | | | o changeset: 7:d376ab0d7fda
414 | | | o changeset: 7:d376ab0d7fda
1338 | | |/ parent: 0:11f7a1b56675
415 | | |/ parent: 0:11f7a1b56675
1339 | | | user: test
416 | | | user: test
1340 | | | date: Thu Jan 01 00:00:00 1970 +0000
417 | | | date: Thu Jan 01 00:00:00 1970 +0000
1341 | | | files: f1f
418 | | | files: f1f
1342 | | | copies: f1f (f1a)
419 | | | copies: f1f (f1a)
1343 | | | description:
420 | | | description:
1344 | | | F0
421 | | | F0
1345 | | |
422 | | |
1346 | | |
423 | | |
1347 | | | diff --git a/f1a b/f1f
424 | | | diff --git a/f1a b/f1f
1348 | | | copy from f1a
425 | | | copy from f1a
1349 | | | copy to f1f
426 | | | copy to f1f
1350 | | |
427 | | |
1351 | o | changeset: 6:6bd1736cab86
428 | o | changeset: 6:6bd1736cab86
1352 | |/ parent: 0:11f7a1b56675
429 | |/ parent: 0:11f7a1b56675
1353 | | user: test
430 | | user: test
1354 | | date: Thu Jan 01 00:00:00 1970 +0000
431 | | date: Thu Jan 01 00:00:00 1970 +0000
1355 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
432 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1356 | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
433 | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1357 | | description:
434 | | description:
1358 | | E0
435 | | E0
1359 | |
436 | |
1360 | |
437 | |
1361 | | diff --git a/f1a b/f1e
438 | | diff --git a/f1a b/f1e
1362 | | rename from f1a
439 | | rename from f1a
1363 | | rename to f1e
440 | | rename to f1e
1364 | | diff --git a/f2a b/f2a
441 | | diff --git a/f2a b/f2a
1365 | | --- a/f2a
442 | | --- a/f2a
1366 | | +++ b/f2a
443 | | +++ b/f2a
1367 | | @@ -1,1 +1,1 @@
444 | | @@ -1,1 +1,1 @@
1368 | | -c2a
445 | | -c2a
1369 | | +c2e
446 | | +c2e
1370 | | diff --git a/f3a b/f3e
447 | | diff --git a/f3a b/f3e
1371 | | rename from f3a
448 | | rename from f3a
1372 | | rename to f3e
449 | | rename to f3e
1373 | | diff --git a/f4a b/f4e
450 | | diff --git a/f4a b/f4e
1374 | | rename from f4a
451 | | rename from f4a
1375 | | rename to f4e
452 | | rename to f4e
1376 | | diff --git a/f5a b/f5b
453 | | diff --git a/f5a b/f5b
1377 | | rename from f5a
454 | | rename from f5a
1378 | | rename to f5b
455 | | rename to f5b
1379 | |
456 | |
1380 | | o changeset: 5:560daee679da
457 | | o changeset: 5:560daee679da
1381 | | | user: test
458 | | | user: test
1382 | | | date: Thu Jan 01 00:00:00 1970 +0000
459 | | | date: Thu Jan 01 00:00:00 1970 +0000
1383 | | | files: f3d f4a
460 | | | files: f3d f4a
1384 | | | description:
461 | | | description:
1385 | | | D1
462 | | | D1
1386 | | |
463 | | |
1387 | | |
464 | | |
1388 | | | diff --git a/f3d b/f3d
465 | | | diff --git a/f3d b/f3d
1389 | | | new file mode 100644
466 | | | new file mode 100644
1390 | | | --- /dev/null
467 | | | --- /dev/null
1391 | | | +++ b/f3d
468 | | | +++ b/f3d
1392 | | | @@ -0,0 +1,1 @@
469 | | | @@ -0,0 +1,1 @@
1393 | | | +c3a
470 | | | +c3a
1394 | | | diff --git a/f4a b/f4a
471 | | | diff --git a/f4a b/f4a
1395 | | | --- a/f4a
472 | | | --- a/f4a
1396 | | | +++ b/f4a
473 | | | +++ b/f4a
1397 | | | @@ -1,1 +1,1 @@
474 | | | @@ -1,1 +1,1 @@
1398 | | | -c4a
475 | | | -c4a
1399 | | | +c4d
476 | | | +c4d
1400 | | |
477 | | |
1401 | | o changeset: 4:c9763722f9bd
478 | | o changeset: 4:c9763722f9bd
1402 | |/ parent: 0:11f7a1b56675
479 | |/ parent: 0:11f7a1b56675
1403 | | user: test
480 | | user: test
1404 | | date: Thu Jan 01 00:00:00 1970 +0000
481 | | date: Thu Jan 01 00:00:00 1970 +0000
1405 | | files: f1a f2a f2c f5a
482 | | files: f1a f2a f2c f5a
1406 | | copies: f2c (f2a)
483 | | copies: f2c (f2a)
1407 | | description:
484 | | description:
1408 | | C1
485 | | C1
1409 | |
486 | |
1410 | |
487 | |
1411 | | diff --git a/f1a b/f1a
488 | | diff --git a/f1a b/f1a
1412 | | --- a/f1a
489 | | --- a/f1a
1413 | | +++ b/f1a
490 | | +++ b/f1a
1414 | | @@ -1,1 +1,1 @@
491 | | @@ -1,1 +1,1 @@
1415 | | -c1a
492 | | -c1a
1416 | | +c1c
493 | | +c1c
1417 | | diff --git a/f2a b/f2c
494 | | diff --git a/f2a b/f2c
1418 | | rename from f2a
495 | | rename from f2a
1419 | | rename to f2c
496 | | rename to f2c
1420 | | diff --git a/f5a b/f5a
497 | | diff --git a/f5a b/f5a
1421 | | --- a/f5a
498 | | --- a/f5a
1422 | | +++ b/f5a
499 | | +++ b/f5a
1423 | | @@ -1,1 +1,1 @@
500 | | @@ -1,1 +1,1 @@
1424 | | -c5a
501 | | -c5a
1425 | | +c5c
502 | | +c5c
1426 | |
503 | |
1427 +---o changeset: 3:b69f5839d2d9
504 +---o changeset: 3:b69f5839d2d9
1428 | | user: test
505 | | user: test
1429 | | date: Thu Jan 01 00:00:00 1970 +0000
506 | | date: Thu Jan 01 00:00:00 1970 +0000
1430 | | files: f3b f3d f4a
507 | | files: f3b f3d f4a
1431 | | copies: f3d (f3b)
508 | | copies: f3d (f3b)
1432 | | description:
509 | | description:
1433 | | D0
510 | | D0
1434 | |
511 | |
1435 | |
512 | |
1436 | | diff --git a/f3b b/f3d
513 | | diff --git a/f3b b/f3d
1437 | | rename from f3b
514 | | rename from f3b
1438 | | rename to f3d
515 | | rename to f3d
1439 | | diff --git a/f4a b/f4a
516 | | diff --git a/f4a b/f4a
1440 | | --- a/f4a
517 | | --- a/f4a
1441 | | +++ b/f4a
518 | | +++ b/f4a
1442 | | @@ -1,1 +1,1 @@
519 | | @@ -1,1 +1,1 @@
1443 | | -c4a
520 | | -c4a
1444 | | +c4d
521 | | +c4d
1445 | |
522 | |
1446 o | changeset: 2:f58c7e2b28fa
523 o | changeset: 2:f58c7e2b28fa
1447 | | user: test
524 | | user: test
1448 | | date: Thu Jan 01 00:00:00 1970 +0000
525 | | date: Thu Jan 01 00:00:00 1970 +0000
1449 | | files: f1b f2a f2c f5a f5b
526 | | files: f1b f2a f2c f5a f5b
1450 | | copies: f2c (f2a) f5a (f5b)
527 | | copies: f2c (f2a) f5a (f5b)
1451 | | description:
528 | | description:
1452 | | C0
529 | | C0
1453 | |
530 | |
1454 | |
531 | |
1455 | | diff --git a/f1b b/f1b
532 | | diff --git a/f1b b/f1b
1456 | | --- a/f1b
533 | | --- a/f1b
1457 | | +++ b/f1b
534 | | +++ b/f1b
1458 | | @@ -1,1 +1,1 @@
535 | | @@ -1,1 +1,1 @@
1459 | | -c1a
536 | | -c1a
1460 | | +c1c
537 | | +c1c
1461 | | diff --git a/f2a b/f2c
538 | | diff --git a/f2a b/f2c
1462 | | rename from f2a
539 | | rename from f2a
1463 | | rename to f2c
540 | | rename to f2c
1464 | | diff --git a/f5b b/f5a
541 | | diff --git a/f5b b/f5a
1465 | | rename from f5b
542 | | rename from f5b
1466 | | rename to f5a
543 | | rename to f5a
1467 | | --- a/f5b
544 | | --- a/f5b
1468 | | +++ b/f5a
545 | | +++ b/f5a
1469 | | @@ -1,1 +1,1 @@
546 | | @@ -1,1 +1,1 @@
1470 | | -c5a
547 | | -c5a
1471 | | +c5c
548 | | +c5c
1472 | |
549 | |
1473 o | changeset: 1:3d7bba921b5d
550 o | changeset: 1:3d7bba921b5d
1474 |/ user: test
551 |/ user: test
1475 | date: Thu Jan 01 00:00:00 1970 +0000
552 | date: Thu Jan 01 00:00:00 1970 +0000
1476 | files: f1a f1b f3a f3b f5a f5b
553 | files: f1a f1b f3a f3b f5a f5b
1477 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
554 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1478 | description:
555 | description:
1479 | B0
556 | B0
1480 |
557 |
1481 |
558 |
1482 | diff --git a/f1a b/f1b
559 | diff --git a/f1a b/f1b
1483 | rename from f1a
560 | rename from f1a
1484 | rename to f1b
561 | rename to f1b
1485 | diff --git a/f3a b/f3b
562 | diff --git a/f3a b/f3b
1486 | rename from f3a
563 | rename from f3a
1487 | rename to f3b
564 | rename to f3b
1488 | diff --git a/f5a b/f5b
565 | diff --git a/f5a b/f5b
1489 | rename from f5a
566 | rename from f5a
1490 | rename to f5b
567 | rename to f5b
1491 |
568 |
1492 o changeset: 0:11f7a1b56675
569 o changeset: 0:11f7a1b56675
1493 user: test
570 user: test
1494 date: Thu Jan 01 00:00:00 1970 +0000
571 date: Thu Jan 01 00:00:00 1970 +0000
1495 files: f1a f2a f3a f4a f5a
572 files: f1a f2a f3a f4a f5a
1496 description:
573 description:
1497 A0
574 A0
1498
575
1499
576
1500 diff --git a/f1a b/f1a
577 diff --git a/f1a b/f1a
1501 new file mode 100644
578 new file mode 100644
1502 --- /dev/null
579 --- /dev/null
1503 +++ b/f1a
580 +++ b/f1a
1504 @@ -0,0 +1,1 @@
581 @@ -0,0 +1,1 @@
1505 +c1a
582 +c1a
1506 diff --git a/f2a b/f2a
583 diff --git a/f2a b/f2a
1507 new file mode 100644
584 new file mode 100644
1508 --- /dev/null
585 --- /dev/null
1509 +++ b/f2a
586 +++ b/f2a
1510 @@ -0,0 +1,1 @@
587 @@ -0,0 +1,1 @@
1511 +c2a
588 +c2a
1512 diff --git a/f3a b/f3a
589 diff --git a/f3a b/f3a
1513 new file mode 100644
590 new file mode 100644
1514 --- /dev/null
591 --- /dev/null
1515 +++ b/f3a
592 +++ b/f3a
1516 @@ -0,0 +1,1 @@
593 @@ -0,0 +1,1 @@
1517 +c3a
594 +c3a
1518 diff --git a/f4a b/f4a
595 diff --git a/f4a b/f4a
1519 new file mode 100644
596 new file mode 100644
1520 --- /dev/null
597 --- /dev/null
1521 +++ b/f4a
598 +++ b/f4a
1522 @@ -0,0 +1,1 @@
599 @@ -0,0 +1,1 @@
1523 +c4a
600 +c4a
1524 diff --git a/f5a b/f5a
601 diff --git a/f5a b/f5a
1525 new file mode 100644
602 new file mode 100644
1526 --- /dev/null
603 --- /dev/null
1527 +++ b/f5a
604 +++ b/f5a
1528 @@ -0,0 +1,1 @@
605 @@ -0,0 +1,1 @@
1529 +c5a
606 +c5a
1530
607
1531 Check superfluous filemerge of files renamed in the past but untouched by graft
608 Check superfluous filemerge of files renamed in the past but untouched by graft
1532
609
1533 $ echo a > a
610 $ echo a > a
1534 $ hg ci -qAma
611 $ hg ci -qAma
1535 $ hg mv a b
612 $ hg mv a b
1536 $ echo b > b
613 $ echo b > b
1537 $ hg ci -qAmb
614 $ hg ci -qAmb
1538 $ echo c > c
615 $ echo c > c
1539 $ hg ci -qAmc
616 $ hg ci -qAmc
1540 $ hg up -q .~2
617 $ hg up -q .~2
1541 $ hg graft tip -qt:fail
618 $ hg graft tip -qt:fail
1542
619
1543 $ cd ..
620 $ cd ..
1544
621
1545 Graft a change into a new file previously grafted into a renamed directory
622 Graft a change into a new file previously grafted into a renamed directory
1546
623
1547 $ hg init dirmovenewfile
624 $ hg init dirmovenewfile
1548 $ cd dirmovenewfile
625 $ cd dirmovenewfile
1549 $ mkdir a
626 $ mkdir a
1550 $ echo a > a/a
627 $ echo a > a/a
1551 $ hg ci -qAma
628 $ hg ci -qAma
1552 $ echo x > a/x
629 $ echo x > a/x
1553 $ hg ci -qAmx
630 $ hg ci -qAmx
1554 $ hg up -q 0
631 $ hg up -q 0
1555 $ hg mv -q a b
632 $ hg mv -q a b
1556 $ hg ci -qAmb
633 $ hg ci -qAmb
1557 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
634 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1558 $ hg up -q 1
635 $ hg up -q 1
1559 $ echo y > a/x
636 $ echo y > a/x
1560 $ hg ci -qAmy
637 $ hg ci -qAmy
1561 $ hg up -q 3
638 $ hg up -q 3
1562 $ hg graft -q 4
639 $ hg graft -q 4
1563 $ hg status --change .
640 $ hg status --change .
1564 M b/x
641 M b/x
1565
642
1566 Prepare for test of skipped changesets and how merges can influence it:
643 Prepare for test of skipped changesets and how merges can influence it:
1567
644
1568 $ hg merge -q -r 1 --tool :local
645 $ hg merge -q -r 1 --tool :local
1569 $ hg ci -m m
646 $ hg ci -m m
1570 $ echo xx >> b/x
647 $ echo xx >> b/x
1571 $ hg ci -m xx
648 $ hg ci -m xx
1572
649
1573 $ hg log -G -T '{rev} {desc|firstline}'
650 $ hg log -G -T '{rev} {desc|firstline}'
1574 @ 7 xx
651 @ 7 xx
1575 |
652 |
1576 o 6 m
653 o 6 m
1577 |\
654 |\
1578 | o 5 y
655 | o 5 y
1579 | |
656 | |
1580 +---o 4 y
657 +---o 4 y
1581 | |
658 | |
1582 | o 3 x
659 | o 3 x
1583 | |
660 | |
1584 | o 2 b
661 | o 2 b
1585 | |
662 | |
1586 o | 1 x
663 o | 1 x
1587 |/
664 |/
1588 o 0 a
665 o 0 a
1589
666
1590 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
667 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1591
668
1592 $ hg up -qCr 4
669 $ hg up -qCr 4
1593 $ hg graft --tool :local -r 2::5
670 $ hg graft --tool :local -r 2::5
1594 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
671 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1595 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
672 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1596 grafting 2:42127f193bcd "b"
673 grafting 2:42127f193bcd "b"
1597
674
1598 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
675 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1599 also detecting that both 3 and 5 should be skipped:
676 also detecting that both 3 and 5 should be skipped:
1600
677
1601 $ hg up -qCr 4
678 $ hg up -qCr 4
1602 $ hg graft --tool :local -r 2::7
679 $ hg graft --tool :local -r 2::7
1603 skipping ungraftable merge revision 6
680 skipping ungraftable merge revision 6
1604 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
681 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1605 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
682 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1606 grafting 2:42127f193bcd "b"
683 grafting 2:42127f193bcd "b"
1607 grafting 7:d3c3f2b38ecc "xx"
684 grafting 7:d3c3f2b38ecc "xx"
1608 note: graft of 7:d3c3f2b38ecc created no changes to commit
685 note: graft of 7:d3c3f2b38ecc created no changes to commit
1609
686
1610 $ cd ..
687 $ cd ..
1611
688
1612 Grafted revision should be warned and skipped only once. (issue6024)
689 Grafted revision should be warned and skipped only once. (issue6024)
1613
690
1614 $ mkdir issue6024
691 $ mkdir issue6024
1615 $ cd issue6024
692 $ cd issue6024
1616
693
1617 $ hg init base
694 $ hg init base
1618 $ cd base
695 $ cd base
1619 $ touch x
696 $ touch x
1620 $ hg commit -qAminit
697 $ hg commit -qAminit
1621 $ echo a > x
698 $ echo a > x
1622 $ hg commit -mchange
699 $ hg commit -mchange
1623 $ hg update -q 0
700 $ hg update -q 0
1624 $ hg graft -r 1
701 $ hg graft -r 1
1625 grafting 1:a0b923c546aa "change" (tip)
702 grafting 1:a0b923c546aa "change" (tip)
1626 $ cd ..
703 $ cd ..
1627
704
1628 $ hg clone -qr 2 base clone
705 $ hg clone -qr 2 base clone
1629 $ cd clone
706 $ cd clone
1630 $ hg pull -q
707 $ hg pull -q
1631 $ hg merge -q 2
708 $ hg merge -q 2
1632 $ hg commit -mmerge
709 $ hg commit -mmerge
1633 $ hg update -q 0
710 $ hg update -q 0
1634 $ hg graft -r 1
711 $ hg graft -r 1
1635 grafting 1:04fc6d444368 "change"
712 grafting 1:04fc6d444368 "change"
1636 $ hg update -q 3
713 $ hg update -q 3
1637 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
714 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1638 o 4:4e16 <- a0b9
715 o 4:4e16 <- a0b9
1639 |
716 |
1640 | @ 3:f0ac <-
717 | @ 3:f0ac <-
1641 | |\
718 | |\
1642 +---o 2:a0b9 <-
719 +---o 2:a0b9 <-
1643 | |
720 | |
1644 | o 1:04fc <- a0b9
721 | o 1:04fc <- a0b9
1645 |/
722 |/
1646 o 0:7848 <-
723 o 0:7848 <-
1647
724
1648
725
1649 the source of rev 4 is an ancestor of the working parent, and was also
726 the source of rev 4 is an ancestor of the working parent, and was also
1650 grafted as rev 1. it should be stripped from the target revisions only once.
727 grafted as rev 1. it should be stripped from the target revisions only once.
1651
728
1652 $ hg graft -r 4
729 $ hg graft -r 4
1653 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
730 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1654 [255]
731 [255]
1655
732
1656 $ cd ../..
733 $ cd ../..
This diff has been collapsed as it changes many lines, (732 lines changed) Show them Hide them
@@ -1,1656 +1,924 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extdiff]
2 > [extdiff]
3 > # for portability:
3 > # for portability:
4 > pdiff = sh "$RUNTESTDIR/pdiff"
4 > pdiff = sh "$RUNTESTDIR/pdiff"
5 > EOF
5 > EOF
6
6
7 Create a repo with some stuff in it:
7 Create a repo with some stuff in it:
8
8
9 $ hg init a
9 $ hg init a
10 $ cd a
10 $ cd a
11 $ echo a > a
11 $ echo a > a
12 $ echo a > d
12 $ echo a > d
13 $ echo a > e
13 $ echo a > e
14 $ hg ci -qAm0
14 $ hg ci -qAm0
15 $ echo b > a
15 $ echo b > a
16 $ hg ci -m1 -u bar
16 $ hg ci -m1 -u bar
17 $ hg mv a b
17 $ hg mv a b
18 $ hg ci -m2
18 $ hg ci -m2
19 $ hg cp b c
19 $ hg cp b c
20 $ hg ci -m3 -u baz
20 $ hg ci -m3 -u baz
21 $ echo b > d
21 $ echo b > d
22 $ echo f > e
22 $ echo f > e
23 $ hg ci -m4
23 $ hg ci -m4
24 $ hg up -q 3
24 $ hg up -q 3
25 $ echo b > e
25 $ echo b > e
26 $ hg branch -q stable
26 $ hg branch -q stable
27 $ hg ci -m5
27 $ hg ci -m5
28 $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4
28 $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4
29 $ hg branch -q default
29 $ hg branch -q default
30 $ hg ci -m6
30 $ hg ci -m6
31 $ hg phase --public 3
31 $ hg phase --public 3
32 $ hg phase --force --secret 6
32 $ hg phase --force --secret 6
33
33
34 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
34 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
35 @ test@6.secret: 6
35 @ test@6.secret: 6
36 |\
36 |\
37 | o test@5.draft: 5
37 | o test@5.draft: 5
38 | |
38 | |
39 o | test@4.draft: 4
39 o | test@4.draft: 4
40 |/
40 |/
41 o baz@3.public: 3
41 o baz@3.public: 3
42 |
42 |
43 o test@2.public: 2
43 o test@2.public: 2
44 |
44 |
45 o bar@1.public: 1
45 o bar@1.public: 1
46 |
46 |
47 o test@0.public: 0
47 o test@0.public: 0
48
48
49 Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d
49 Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d
50
50
51 $ hg up -cqr 3
51 $ hg up -cqr 3
52 $ hg graft -r 6 --base 5
52 $ hg graft -r 6 --base 5
53 grafting 6:25a2b029d3ae "6" (tip)
53 grafting 6:25a2b029d3ae "6" (tip)
54 merging e
54 merging e
55 $ hg st --change .
55 $ hg st --change .
56 M d
56 M d
57
57
58 $ hg -q strip . --config extensions.strip=
58 $ hg -q strip . --config extensions.strip=
59
59
60 Test --base for collapsing changesets 2 and 3, thus getting both b and c
60 Test --base for collapsing changesets 2 and 3, thus getting both b and c
61
61
62 $ hg up -cqr 0
62 $ hg up -cqr 0
63 $ hg graft -r 3 --base 1
63 $ hg graft -r 3 --base 1
64 grafting 3:4c60f11aa304 "3"
64 grafting 3:4c60f11aa304 "3"
65 merging a and b to b
65 merging a and b to b
66 merging a and c to c
66 merging a and c to c
67 $ hg st --change .
67 $ hg st --change .
68 A b
68 A b
69 A c
69 A c
70 R a
70 R a
71
71
72 $ hg -q strip . --config extensions.strip=
72 $ hg -q strip . --config extensions.strip=
73
73
74 Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent)
74 Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent)
75
75
76 $ hg graft -r 2 --base 3
76 $ hg graft -r 2 --base 3
77 grafting 2:5c095ad7e90f "2"
77 grafting 2:5c095ad7e90f "2"
78 note: possible conflict - c was deleted and renamed to:
78 note: possible conflict - c was deleted and renamed to:
79 a
79 a
80 note: graft of 2:5c095ad7e90f created no changes to commit
80 note: graft of 2:5c095ad7e90f created no changes to commit
81
81
82 Can't continue without starting:
82 Can't continue without starting:
83
83
84 $ hg -q up -cr tip
84 $ hg -q up -cr tip
85 $ hg rm -q e
85 $ hg rm -q e
86 $ hg graft --continue
86 $ hg graft --continue
87 abort: no graft in progress
87 abort: no graft in progress
88 [255]
88 [255]
89 $ hg revert -r . -q e
89 $ hg revert -r . -q e
90
90
91 Need to specify a rev:
91 Need to specify a rev:
92
92
93 $ hg graft
93 $ hg graft
94 abort: no revisions specified
94 abort: no revisions specified
95 [255]
95 [255]
96
96
97 Can't graft ancestor:
97 Can't graft ancestor:
98
98
99 $ hg graft 1 2
99 $ hg graft 1 2
100 skipping ancestor revision 1:5d205f8b35b6
100 skipping ancestor revision 1:5d205f8b35b6
101 skipping ancestor revision 2:5c095ad7e90f
101 skipping ancestor revision 2:5c095ad7e90f
102 [255]
102 [255]
103
103
104 Specify revisions with -r:
104 Specify revisions with -r:
105
105
106 $ hg graft -r 1 -r 2
106 $ hg graft -r 1 -r 2
107 skipping ancestor revision 1:5d205f8b35b6
107 skipping ancestor revision 1:5d205f8b35b6
108 skipping ancestor revision 2:5c095ad7e90f
108 skipping ancestor revision 2:5c095ad7e90f
109 [255]
109 [255]
110
110
111 $ hg graft -r 1 2
111 $ hg graft -r 1 2
112 warning: inconsistent use of --rev might give unexpected revision ordering!
112 warning: inconsistent use of --rev might give unexpected revision ordering!
113 skipping ancestor revision 2:5c095ad7e90f
113 skipping ancestor revision 2:5c095ad7e90f
114 skipping ancestor revision 1:5d205f8b35b6
114 skipping ancestor revision 1:5d205f8b35b6
115 [255]
115 [255]
116
116
117 Conflicting date/user options:
117 Conflicting date/user options:
118
118
119 $ hg up -q 0
119 $ hg up -q 0
120 $ hg graft -U --user foo 2
120 $ hg graft -U --user foo 2
121 abort: cannot specify both --user and --currentuser
121 abort: cannot specify both --user and --currentuser
122 [255]
122 [255]
123 $ hg graft -D --date '0 0' 2
123 $ hg graft -D --date '0 0' 2
124 abort: cannot specify both --date and --currentdate
124 abort: cannot specify both --date and --currentdate
125 [255]
125 [255]
126
126
127 Can't graft with dirty wd:
127 Can't graft with dirty wd:
128
128
129 $ hg up -q 0
129 $ hg up -q 0
130 $ echo foo > a
130 $ echo foo > a
131 $ hg graft 1
131 $ hg graft 1
132 abort: uncommitted changes
132 abort: uncommitted changes
133 [255]
133 [255]
134 $ hg revert a
134 $ hg revert a
135
135
136 Graft a rename:
136 Graft a rename:
137 (this also tests that editor is invoked if '--edit' is specified)
137 (this also tests that editor is invoked if '--edit' is specified)
138
138
139 $ hg status --rev "2^1" --rev 2
139 $ hg status --rev "2^1" --rev 2
140 A b
140 A b
141 R a
141 R a
142 $ HGEDITOR=cat hg graft 2 -u foo --edit
142 $ HGEDITOR=cat hg graft 2 -u foo --edit
143 grafting 2:5c095ad7e90f "2"
143 grafting 2:5c095ad7e90f "2"
144 merging a and b to b
144 merging a and b to b
145 2
145 2
146
146
147
147
148 HG: Enter commit message. Lines beginning with 'HG:' are removed.
148 HG: Enter commit message. Lines beginning with 'HG:' are removed.
149 HG: Leave message empty to abort commit.
149 HG: Leave message empty to abort commit.
150 HG: --
150 HG: --
151 HG: user: foo
151 HG: user: foo
152 HG: branch 'default'
152 HG: branch 'default'
153 HG: added b
153 HG: added b
154 HG: removed a
154 HG: removed a
155 $ hg export tip --git
155 $ hg export tip --git
156 # HG changeset patch
156 # HG changeset patch
157 # User foo
157 # User foo
158 # Date 0 0
158 # Date 0 0
159 # Thu Jan 01 00:00:00 1970 +0000
159 # Thu Jan 01 00:00:00 1970 +0000
160 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
160 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
161 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
161 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
162 2
162 2
163
163
164 diff --git a/a b/b
164 diff --git a/a b/b
165 rename from a
165 rename from a
166 rename to b
166 rename to b
167
167
168 Look for extra:source
168 Look for extra:source
169
169
170 $ hg log --debug -r tip
170 $ hg log --debug -r tip
171 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
171 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
172 tag: tip
172 tag: tip
173 phase: draft
173 phase: draft
174 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
174 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
175 parent: -1:0000000000000000000000000000000000000000
175 parent: -1:0000000000000000000000000000000000000000
176 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
176 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
177 user: foo
177 user: foo
178 date: Thu Jan 01 00:00:00 1970 +0000
178 date: Thu Jan 01 00:00:00 1970 +0000
179 files+: b
179 files+: b
180 files-: a
180 files-: a
181 extra: branch=default
181 extra: branch=default
182 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
182 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
183 description:
183 description:
184 2
184 2
185
185
186
186
187
187
188 Graft out of order, skipping a merge and a duplicate
188 Graft out of order, skipping a merge and a duplicate
189 (this also tests that editor is not invoked if '--edit' is not specified)
189 (this also tests that editor is not invoked if '--edit' is not specified)
190
190
191 $ hg graft 1 5 4 3 'merge()' 2 -n
191 $ hg graft 1 5 4 3 'merge()' 2 -n
192 skipping ungraftable merge revision 6
192 skipping ungraftable merge revision 6
193 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
193 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
194 grafting 1:5d205f8b35b6 "1"
194 grafting 1:5d205f8b35b6 "1"
195 grafting 5:97f8bfe72746 "5"
195 grafting 5:97f8bfe72746 "5"
196 grafting 4:9c233e8e184d "4"
196 grafting 4:9c233e8e184d "4"
197 grafting 3:4c60f11aa304 "3"
197 grafting 3:4c60f11aa304 "3"
198
198
199 $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
199 $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
200 skipping ungraftable merge revision 6
200 skipping ungraftable merge revision 6
201 scanning for duplicate grafts
201 scanning for duplicate grafts
202 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
202 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
203 grafting 1:5d205f8b35b6 "1"
203 grafting 1:5d205f8b35b6 "1"
204 unmatched files in local:
204 unmatched files in local:
205 b
205 b
206 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
206 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
207 src: 'a' -> dst: 'b' *
207 src: 'a' -> dst: 'b' *
208 checking for directory renames
208 checking for directory renames
209 resolving manifests
209 resolving manifests
210 branchmerge: True, force: True, partial: False
210 branchmerge: True, force: True, partial: False
211 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
211 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
212 preserving b for resolve of b
212 preserving b for resolve of b
213 starting 4 threads for background file closing (?)
213 starting 4 threads for background file closing (?)
214 b: local copied/moved from a -> m (premerge)
214 b: local copied/moved from a -> m (premerge)
215 picked tool ':merge' for b (binary False symlink False changedelete False)
215 picked tool ':merge' for b (binary False symlink False changedelete False)
216 merging b and a to b
216 merging b and a to b
217 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
217 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
218 premerge successful
218 premerge successful
219 committing files:
219 committing files:
220 b
220 b
221 committing manifest
221 committing manifest
222 committing changelog
222 committing changelog
223 updating the branch cache
223 updating the branch cache
224 grafting 5:97f8bfe72746 "5"
224 grafting 5:97f8bfe72746 "5"
225 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
225 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
226 src: 'c' -> dst: 'b'
226 src: 'c' -> dst: 'b'
227 checking for directory renames
227 checking for directory renames
228 resolving manifests
228 resolving manifests
229 branchmerge: True, force: True, partial: False
229 branchmerge: True, force: True, partial: False
230 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
230 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
231 e: remote is newer -> g
231 e: remote is newer -> g
232 getting e
232 getting e
233 committing files:
233 committing files:
234 e
234 e
235 committing manifest
235 committing manifest
236 committing changelog
236 committing changelog
237 updating the branch cache
237 updating the branch cache
238 $ HGEDITOR=cat hg graft 4 3 --log --debug
238 $ HGEDITOR=cat hg graft 4 3 --log --debug
239 scanning for duplicate grafts
239 scanning for duplicate grafts
240 grafting 4:9c233e8e184d "4"
240 grafting 4:9c233e8e184d "4"
241 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
241 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
242 src: 'c' -> dst: 'b'
242 src: 'c' -> dst: 'b'
243 checking for directory renames
243 checking for directory renames
244 resolving manifests
244 resolving manifests
245 branchmerge: True, force: True, partial: False
245 branchmerge: True, force: True, partial: False
246 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
246 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
247 preserving e for resolve of e
247 preserving e for resolve of e
248 d: remote is newer -> g
248 d: remote is newer -> g
249 getting d
249 getting d
250 e: versions differ -> m (premerge)
250 e: versions differ -> m (premerge)
251 picked tool ':merge' for e (binary False symlink False changedelete False)
251 picked tool ':merge' for e (binary False symlink False changedelete False)
252 merging e
252 merging e
253 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
253 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
254 e: versions differ -> m (merge)
254 e: versions differ -> m (merge)
255 picked tool ':merge' for e (binary False symlink False changedelete False)
255 picked tool ':merge' for e (binary False symlink False changedelete False)
256 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
256 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
257 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
257 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
258 abort: unresolved conflicts, can't continue
258 abort: unresolved conflicts, can't continue
259 (use 'hg resolve' and 'hg graft --continue')
259 (use 'hg resolve' and 'hg graft --continue')
260 [255]
260 [255]
261
261
262 Summary should mention graft:
262 Summary should mention graft:
263
263
264 $ hg summary |grep graft
264 $ hg summary |grep graft
265 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
265 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
266
266
267 Using status to get more context
267 Using status to get more context
268
268
269 $ hg status --verbose
269 $ hg status --verbose
270 M d
270 M d
271 M e
271 M e
272 ? a.orig
272 ? a.orig
273 ? e.orig
273 ? e.orig
274 # The repository is in an unfinished *graft* state.
274 # The repository is in an unfinished *graft* state.
275
275
276 # Unresolved merge conflicts:
276 # Unresolved merge conflicts:
277 #
277 #
278 # e
278 # e
279 #
279 #
280 # To mark files as resolved: hg resolve --mark FILE
280 # To mark files as resolved: hg resolve --mark FILE
281
281
282 # To continue: hg graft --continue
282 # To continue: hg graft --continue
283 # To abort: hg graft --abort
283 # To abort: hg graft --abort
284 # To stop: hg graft --stop
284 # To stop: hg graft --stop
285
285
286
286
287 Commit while interrupted should fail:
287 Commit while interrupted should fail:
288
288
289 $ hg ci -m 'commit interrupted graft'
289 $ hg ci -m 'commit interrupted graft'
290 abort: graft in progress
290 abort: graft in progress
291 (use 'hg graft --continue' or 'hg graft --stop' to stop)
291 (use 'hg graft --continue' or 'hg graft --stop' to stop)
292 [255]
292 [255]
293
293
294 Abort the graft and try committing:
294 Abort the graft and try committing:
295
295
296 $ hg up -C .
296 $ hg up -C .
297 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
297 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 $ echo c >> e
298 $ echo c >> e
299 $ hg ci -mtest
299 $ hg ci -mtest
300
300
301 $ hg strip . --config extensions.strip=
301 $ hg strip . --config extensions.strip=
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
303 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
303 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
304
304
305 Graft again:
305 Graft again:
306
306
307 $ hg graft 1 5 4 3 'merge()' 2
307 $ hg graft 1 5 4 3 'merge()' 2
308 skipping ungraftable merge revision 6
308 skipping ungraftable merge revision 6
309 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
309 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
310 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
310 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
311 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
311 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
312 grafting 4:9c233e8e184d "4"
312 grafting 4:9c233e8e184d "4"
313 merging e
313 merging e
314 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
314 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
315 abort: unresolved conflicts, can't continue
315 abort: unresolved conflicts, can't continue
316 (use 'hg resolve' and 'hg graft --continue')
316 (use 'hg resolve' and 'hg graft --continue')
317 [255]
317 [255]
318
318
319 Continue without resolve should fail:
319 Continue without resolve should fail:
320
320
321 $ hg graft -c
321 $ hg graft -c
322 grafting 4:9c233e8e184d "4"
322 grafting 4:9c233e8e184d "4"
323 abort: unresolved merge conflicts (see 'hg help resolve')
323 abort: unresolved merge conflicts (see 'hg help resolve')
324 [255]
324 [255]
325
325
326 Fix up:
326 Fix up:
327
327
328 $ echo b > e
328 $ echo b > e
329 $ hg resolve -m e
329 $ hg resolve -m e
330 (no more unresolved files)
330 (no more unresolved files)
331 continue: hg graft --continue
331 continue: hg graft --continue
332
332
333 Continue with a revision should fail:
333 Continue with a revision should fail:
334
334
335 $ hg graft -c 6
335 $ hg graft -c 6
336 abort: can't specify --continue and revisions
336 abort: can't specify --continue and revisions
337 [255]
337 [255]
338
338
339 $ hg graft -c -r 6
339 $ hg graft -c -r 6
340 abort: can't specify --continue and revisions
340 abort: can't specify --continue and revisions
341 [255]
341 [255]
342
342
343 Continue for real, clobber usernames
343 Continue for real, clobber usernames
344
344
345 $ hg graft -c -U
345 $ hg graft -c -U
346 grafting 4:9c233e8e184d "4"
346 grafting 4:9c233e8e184d "4"
347 grafting 3:4c60f11aa304 "3"
347 grafting 3:4c60f11aa304 "3"
348
348
349 Compare with original:
349 Compare with original:
350
350
351 $ hg diff -r 6
351 $ hg diff -r 6
352 $ hg status --rev 0:. -C
352 $ hg status --rev 0:. -C
353 M d
353 M d
354 M e
354 M e
355 A b
355 A b
356 a
356 a
357 A c
357 A c
358 a
358 a
359 R a
359 R a
360
360
361 View graph:
361 View graph:
362
362
363 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
363 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
364 @ test@11.draft: 3
364 @ test@11.draft: 3
365 |
365 |
366 o test@10.draft: 4
366 o test@10.draft: 4
367 |
367 |
368 o test@9.draft: 5
368 o test@9.draft: 5
369 |
369 |
370 o bar@8.draft: 1
370 o bar@8.draft: 1
371 |
371 |
372 o foo@7.draft: 2
372 o foo@7.draft: 2
373 |
373 |
374 | o test@6.secret: 6
374 | o test@6.secret: 6
375 | |\
375 | |\
376 | | o test@5.draft: 5
376 | | o test@5.draft: 5
377 | | |
377 | | |
378 | o | test@4.draft: 4
378 | o | test@4.draft: 4
379 | |/
379 | |/
380 | o baz@3.public: 3
380 | o baz@3.public: 3
381 | |
381 | |
382 | o test@2.public: 2
382 | o test@2.public: 2
383 | |
383 | |
384 | o bar@1.public: 1
384 | o bar@1.public: 1
385 |/
385 |/
386 o test@0.public: 0
386 o test@0.public: 0
387
387
388 Graft again onto another branch should preserve the original source
388 Graft again onto another branch should preserve the original source
389 $ hg up -q 0
389 $ hg up -q 0
390 $ echo 'g'>g
390 $ echo 'g'>g
391 $ hg add g
391 $ hg add g
392 $ hg ci -m 7
392 $ hg ci -m 7
393 created new head
393 created new head
394 $ hg graft 7
394 $ hg graft 7
395 grafting 7:ef0ef43d49e7 "2"
395 grafting 7:ef0ef43d49e7 "2"
396
396
397 $ hg log -r 7 --template '{rev}:{node}\n'
397 $ hg log -r 7 --template '{rev}:{node}\n'
398 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
398 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
399 $ hg log -r 2 --template '{rev}:{node}\n'
399 $ hg log -r 2 --template '{rev}:{node}\n'
400 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
400 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
401
401
402 $ hg log --debug -r tip
402 $ hg log --debug -r tip
403 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
403 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
404 tag: tip
404 tag: tip
405 phase: draft
405 phase: draft
406 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
406 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
407 parent: -1:0000000000000000000000000000000000000000
407 parent: -1:0000000000000000000000000000000000000000
408 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
408 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
409 user: foo
409 user: foo
410 date: Thu Jan 01 00:00:00 1970 +0000
410 date: Thu Jan 01 00:00:00 1970 +0000
411 files+: b
411 files+: b
412 files-: a
412 files-: a
413 extra: branch=default
413 extra: branch=default
414 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
414 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
415 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
415 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
416 description:
416 description:
417 2
417 2
418
418
419
419
420 Disallow grafting an already grafted cset onto its original branch
420 Disallow grafting an already grafted cset onto its original branch
421 $ hg up -q 6
421 $ hg up -q 6
422 $ hg graft 7
422 $ hg graft 7
423 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
423 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
424 [255]
424 [255]
425
425
426 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
426 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
427 --- */hg-5c095ad7e90f.patch * (glob)
427 --- */hg-5c095ad7e90f.patch * (glob)
428 +++ */hg-7a4785234d87.patch * (glob)
428 +++ */hg-7a4785234d87.patch * (glob)
429 @@ -1,18 +1,18 @@
429 @@ -1,18 +1,18 @@
430 # HG changeset patch
430 # HG changeset patch
431 -# User test
431 -# User test
432 +# User foo
432 +# User foo
433 # Date 0 0
433 # Date 0 0
434 # Thu Jan 01 00:00:00 1970 +0000
434 # Thu Jan 01 00:00:00 1970 +0000
435 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
435 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
436 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
436 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
437 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
437 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
438 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
438 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
439 2
439 2
440
440
441 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
441 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
442 +diff -r b592ea63bb0c -r 7a4785234d87 a
442 +diff -r b592ea63bb0c -r 7a4785234d87 a
443 --- a/a Thu Jan 01 00:00:00 1970 +0000
443 --- a/a Thu Jan 01 00:00:00 1970 +0000
444 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
444 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
445 @@ -1,1 +0,0 @@
445 @@ -1,1 +0,0 @@
446 --b
446 --b
447 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
447 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
448 +-a
448 +-a
449 +diff -r b592ea63bb0c -r 7a4785234d87 b
449 +diff -r b592ea63bb0c -r 7a4785234d87 b
450 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
450 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
451 +++ b/b Thu Jan 01 00:00:00 1970 +0000
451 +++ b/b Thu Jan 01 00:00:00 1970 +0000
452 @@ -0,0 +1,1 @@
452 @@ -0,0 +1,1 @@
453 -+b
453 -+b
454 ++a
454 ++a
455 [1]
455 [1]
456
456
457 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
457 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
458 --- */hg-5c095ad7e90f.patch * (glob)
458 --- */hg-5c095ad7e90f.patch * (glob)
459 +++ */hg-7a4785234d87.patch * (glob)
459 +++ */hg-7a4785234d87.patch * (glob)
460 @@ -1,8 +1,8 @@
460 @@ -1,8 +1,8 @@
461 # HG changeset patch
461 # HG changeset patch
462 -# User test
462 -# User test
463 +# User foo
463 +# User foo
464 # Date 0 0
464 # Date 0 0
465 # Thu Jan 01 00:00:00 1970 +0000
465 # Thu Jan 01 00:00:00 1970 +0000
466 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
466 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
467 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
467 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
468 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
468 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
469 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
469 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
470 2
470 2
471
471
472 [1]
472 [1]
473
473
474 Disallow grafting already grafted csets with the same origin onto each other
474 Disallow grafting already grafted csets with the same origin onto each other
475 $ hg up -q 13
475 $ hg up -q 13
476 $ hg graft 2
476 $ hg graft 2
477 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
477 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
478 [255]
478 [255]
479 $ hg graft 7
479 $ hg graft 7
480 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
480 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
481 [255]
481 [255]
482
482
483 $ hg up -q 7
483 $ hg up -q 7
484 $ hg graft 2
484 $ hg graft 2
485 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
485 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
486 [255]
486 [255]
487 $ hg graft tip
487 $ hg graft tip
488 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
488 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
489 [255]
489 [255]
490
490
491 Graft with --log
491 Graft with --log
492
492
493 $ hg up -Cq 1
493 $ hg up -Cq 1
494 $ hg graft 3 --log -u foo
494 $ hg graft 3 --log -u foo
495 grafting 3:4c60f11aa304 "3"
495 grafting 3:4c60f11aa304 "3"
496 warning: can't find ancestor for 'c' copied from 'b'!
496 warning: can't find ancestor for 'c' copied from 'b'!
497 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
497 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
498 14:0c921c65ef1e 1:5d205f8b35b6 3
498 14:0c921c65ef1e 1:5d205f8b35b6 3
499 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
499 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
500
500
501 Resolve conflicted graft
501 Resolve conflicted graft
502 $ hg up -q 0
502 $ hg up -q 0
503 $ echo b > a
503 $ echo b > a
504 $ hg ci -m 8
504 $ hg ci -m 8
505 created new head
505 created new head
506 $ echo c > a
506 $ echo c > a
507 $ hg ci -m 9
507 $ hg ci -m 9
508 $ hg graft 1 --tool internal:fail
508 $ hg graft 1 --tool internal:fail
509 grafting 1:5d205f8b35b6 "1"
509 grafting 1:5d205f8b35b6 "1"
510 abort: unresolved conflicts, can't continue
510 abort: unresolved conflicts, can't continue
511 (use 'hg resolve' and 'hg graft --continue')
511 (use 'hg resolve' and 'hg graft --continue')
512 [255]
512 [255]
513 $ hg resolve --all
513 $ hg resolve --all
514 merging a
514 merging a
515 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
515 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
516 [1]
516 [1]
517 $ cat a
517 $ cat a
518 <<<<<<< local: aaa4406d4f0a - test: 9
518 <<<<<<< local: aaa4406d4f0a - test: 9
519 c
519 c
520 =======
520 =======
521 b
521 b
522 >>>>>>> graft: 5d205f8b35b6 - bar: 1
522 >>>>>>> graft: 5d205f8b35b6 - bar: 1
523 $ echo b > a
523 $ echo b > a
524 $ hg resolve -m a
524 $ hg resolve -m a
525 (no more unresolved files)
525 (no more unresolved files)
526 continue: hg graft --continue
526 continue: hg graft --continue
527 $ hg graft -c
527 $ hg graft -c
528 grafting 1:5d205f8b35b6 "1"
528 grafting 1:5d205f8b35b6 "1"
529 $ hg export tip --git
529 $ hg export tip --git
530 # HG changeset patch
530 # HG changeset patch
531 # User bar
531 # User bar
532 # Date 0 0
532 # Date 0 0
533 # Thu Jan 01 00:00:00 1970 +0000
533 # Thu Jan 01 00:00:00 1970 +0000
534 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
534 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
535 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
535 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
536 1
536 1
537
537
538 diff --git a/a b/a
538 diff --git a/a b/a
539 --- a/a
539 --- a/a
540 +++ b/a
540 +++ b/a
541 @@ -1,1 +1,1 @@
541 @@ -1,1 +1,1 @@
542 -c
542 -c
543 +b
543 +b
544
544
545 Resolve conflicted graft with rename
545 Resolve conflicted graft with rename
546 $ echo c > a
546 $ echo c > a
547 $ hg ci -m 10
547 $ hg ci -m 10
548 $ hg graft 2 --tool internal:fail
548 $ hg graft 2 --tool internal:fail
549 grafting 2:5c095ad7e90f "2"
549 grafting 2:5c095ad7e90f "2"
550 abort: unresolved conflicts, can't continue
550 abort: unresolved conflicts, can't continue
551 (use 'hg resolve' and 'hg graft --continue')
551 (use 'hg resolve' and 'hg graft --continue')
552 [255]
552 [255]
553 $ hg resolve --all
553 $ hg resolve --all
554 merging a and b to b
554 merging a and b to b
555 (no more unresolved files)
555 (no more unresolved files)
556 continue: hg graft --continue
556 continue: hg graft --continue
557 $ hg graft -c
557 $ hg graft -c
558 grafting 2:5c095ad7e90f "2"
558 grafting 2:5c095ad7e90f "2"
559 $ hg export tip --git
559 $ hg export tip --git
560 # HG changeset patch
560 # HG changeset patch
561 # User test
561 # User test
562 # Date 0 0
562 # Date 0 0
563 # Thu Jan 01 00:00:00 1970 +0000
563 # Thu Jan 01 00:00:00 1970 +0000
564 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
564 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
565 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
565 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
566 2
566 2
567
567
568 diff --git a/a b/b
568 diff --git a/a b/b
569 rename from a
569 rename from a
570 rename to b
570 rename to b
571
571
572 Test simple origin(), with and without args
572 Test simple origin(), with and without args
573 $ hg log -r 'origin()'
573 $ hg log -r 'origin()'
574 changeset: 1:5d205f8b35b6
574 changeset: 1:5d205f8b35b6
575 user: bar
575 user: bar
576 date: Thu Jan 01 00:00:00 1970 +0000
576 date: Thu Jan 01 00:00:00 1970 +0000
577 summary: 1
577 summary: 1
578
578
579 changeset: 2:5c095ad7e90f
579 changeset: 2:5c095ad7e90f
580 user: test
580 user: test
581 date: Thu Jan 01 00:00:00 1970 +0000
581 date: Thu Jan 01 00:00:00 1970 +0000
582 summary: 2
582 summary: 2
583
583
584 changeset: 3:4c60f11aa304
584 changeset: 3:4c60f11aa304
585 user: baz
585 user: baz
586 date: Thu Jan 01 00:00:00 1970 +0000
586 date: Thu Jan 01 00:00:00 1970 +0000
587 summary: 3
587 summary: 3
588
588
589 changeset: 4:9c233e8e184d
589 changeset: 4:9c233e8e184d
590 user: test
590 user: test
591 date: Thu Jan 01 00:00:00 1970 +0000
591 date: Thu Jan 01 00:00:00 1970 +0000
592 summary: 4
592 summary: 4
593
593
594 changeset: 5:97f8bfe72746
594 changeset: 5:97f8bfe72746
595 branch: stable
595 branch: stable
596 parent: 3:4c60f11aa304
596 parent: 3:4c60f11aa304
597 user: test
597 user: test
598 date: Thu Jan 01 00:00:00 1970 +0000
598 date: Thu Jan 01 00:00:00 1970 +0000
599 summary: 5
599 summary: 5
600
600
601 $ hg log -r 'origin(7)'
601 $ hg log -r 'origin(7)'
602 changeset: 2:5c095ad7e90f
602 changeset: 2:5c095ad7e90f
603 user: test
603 user: test
604 date: Thu Jan 01 00:00:00 1970 +0000
604 date: Thu Jan 01 00:00:00 1970 +0000
605 summary: 2
605 summary: 2
606
606
607 Now transplant a graft to test following through copies
607 Now transplant a graft to test following through copies
608 $ hg up -q 0
608 $ hg up -q 0
609 $ hg branch -q dev
609 $ hg branch -q dev
610 $ hg ci -qm "dev branch"
610 $ hg ci -qm "dev branch"
611 $ hg --config extensions.transplant= transplant -q 7
611 $ hg --config extensions.transplant= transplant -q 7
612 $ hg log -r 'origin(.)'
612 $ hg log -r 'origin(.)'
613 changeset: 2:5c095ad7e90f
613 changeset: 2:5c095ad7e90f
614 user: test
614 user: test
615 date: Thu Jan 01 00:00:00 1970 +0000
615 date: Thu Jan 01 00:00:00 1970 +0000
616 summary: 2
616 summary: 2
617
617
618 Test that the graft and transplant markers in extra are converted, allowing
618 Test that the graft and transplant markers in extra are converted, allowing
619 origin() to still work. Note that these recheck the immediately preceeding two
619 origin() to still work. Note that these recheck the immediately preceeding two
620 tests.
620 tests.
621 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
621 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
622
622
623 The graft case
623 The graft case
624 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
624 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
625 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
625 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
626 branch=default
626 branch=default
627 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
627 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
628 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
628 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
629 $ hg -R ../converted log -r 'origin(7)'
629 $ hg -R ../converted log -r 'origin(7)'
630 changeset: 2:e0213322b2c1
630 changeset: 2:e0213322b2c1
631 user: test
631 user: test
632 date: Thu Jan 01 00:00:00 1970 +0000
632 date: Thu Jan 01 00:00:00 1970 +0000
633 summary: 2
633 summary: 2
634
634
635 Test that template correctly expands more than one 'extra' (issue4362), and that
635 Test that template correctly expands more than one 'extra' (issue4362), and that
636 'intermediate-source' is converted.
636 'intermediate-source' is converted.
637 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
637 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
638 Extra: branch=default
638 Extra: branch=default
639 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
639 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
640 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
640 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
641 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
641 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
642
642
643 The transplant case
643 The transplant case
644 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
644 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
645 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
645 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
646 branch=dev
646 branch=dev
647 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
647 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
648 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
648 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
649 $ hg -R ../converted log -r 'origin(tip)'
649 $ hg -R ../converted log -r 'origin(tip)'
650 changeset: 2:e0213322b2c1
650 changeset: 2:e0213322b2c1
651 user: test
651 user: test
652 date: Thu Jan 01 00:00:00 1970 +0000
652 date: Thu Jan 01 00:00:00 1970 +0000
653 summary: 2
653 summary: 2
654
654
655
655
656 Test simple destination
656 Test simple destination
657 $ hg log -r 'destination()'
657 $ hg log -r 'destination()'
658 changeset: 7:ef0ef43d49e7
658 changeset: 7:ef0ef43d49e7
659 parent: 0:68795b066622
659 parent: 0:68795b066622
660 user: foo
660 user: foo
661 date: Thu Jan 01 00:00:00 1970 +0000
661 date: Thu Jan 01 00:00:00 1970 +0000
662 summary: 2
662 summary: 2
663
663
664 changeset: 8:6b9e5368ca4e
664 changeset: 8:6b9e5368ca4e
665 user: bar
665 user: bar
666 date: Thu Jan 01 00:00:00 1970 +0000
666 date: Thu Jan 01 00:00:00 1970 +0000
667 summary: 1
667 summary: 1
668
668
669 changeset: 9:1905859650ec
669 changeset: 9:1905859650ec
670 user: test
670 user: test
671 date: Thu Jan 01 00:00:00 1970 +0000
671 date: Thu Jan 01 00:00:00 1970 +0000
672 summary: 5
672 summary: 5
673
673
674 changeset: 10:52dc0b4c6907
674 changeset: 10:52dc0b4c6907
675 user: test
675 user: test
676 date: Thu Jan 01 00:00:00 1970 +0000
676 date: Thu Jan 01 00:00:00 1970 +0000
677 summary: 4
677 summary: 4
678
678
679 changeset: 11:882b35362a6b
679 changeset: 11:882b35362a6b
680 user: test
680 user: test
681 date: Thu Jan 01 00:00:00 1970 +0000
681 date: Thu Jan 01 00:00:00 1970 +0000
682 summary: 3
682 summary: 3
683
683
684 changeset: 13:7a4785234d87
684 changeset: 13:7a4785234d87
685 user: foo
685 user: foo
686 date: Thu Jan 01 00:00:00 1970 +0000
686 date: Thu Jan 01 00:00:00 1970 +0000
687 summary: 2
687 summary: 2
688
688
689 changeset: 14:0c921c65ef1e
689 changeset: 14:0c921c65ef1e
690 parent: 1:5d205f8b35b6
690 parent: 1:5d205f8b35b6
691 user: foo
691 user: foo
692 date: Thu Jan 01 00:00:00 1970 +0000
692 date: Thu Jan 01 00:00:00 1970 +0000
693 summary: 3
693 summary: 3
694
694
695 changeset: 17:f67661df0c48
695 changeset: 17:f67661df0c48
696 user: bar
696 user: bar
697 date: Thu Jan 01 00:00:00 1970 +0000
697 date: Thu Jan 01 00:00:00 1970 +0000
698 summary: 1
698 summary: 1
699
699
700 changeset: 19:9627f653b421
700 changeset: 19:9627f653b421
701 user: test
701 user: test
702 date: Thu Jan 01 00:00:00 1970 +0000
702 date: Thu Jan 01 00:00:00 1970 +0000
703 summary: 2
703 summary: 2
704
704
705 changeset: 21:7e61b508e709
705 changeset: 21:7e61b508e709
706 branch: dev
706 branch: dev
707 tag: tip
707 tag: tip
708 user: foo
708 user: foo
709 date: Thu Jan 01 00:00:00 1970 +0000
709 date: Thu Jan 01 00:00:00 1970 +0000
710 summary: 2
710 summary: 2
711
711
712 $ hg log -r 'destination(2)'
712 $ hg log -r 'destination(2)'
713 changeset: 7:ef0ef43d49e7
713 changeset: 7:ef0ef43d49e7
714 parent: 0:68795b066622
714 parent: 0:68795b066622
715 user: foo
715 user: foo
716 date: Thu Jan 01 00:00:00 1970 +0000
716 date: Thu Jan 01 00:00:00 1970 +0000
717 summary: 2
717 summary: 2
718
718
719 changeset: 13:7a4785234d87
719 changeset: 13:7a4785234d87
720 user: foo
720 user: foo
721 date: Thu Jan 01 00:00:00 1970 +0000
721 date: Thu Jan 01 00:00:00 1970 +0000
722 summary: 2
722 summary: 2
723
723
724 changeset: 19:9627f653b421
724 changeset: 19:9627f653b421
725 user: test
725 user: test
726 date: Thu Jan 01 00:00:00 1970 +0000
726 date: Thu Jan 01 00:00:00 1970 +0000
727 summary: 2
727 summary: 2
728
728
729 changeset: 21:7e61b508e709
729 changeset: 21:7e61b508e709
730 branch: dev
730 branch: dev
731 tag: tip
731 tag: tip
732 user: foo
732 user: foo
733 date: Thu Jan 01 00:00:00 1970 +0000
733 date: Thu Jan 01 00:00:00 1970 +0000
734 summary: 2
734 summary: 2
735
735
736 Transplants of grafts can find a destination...
736 Transplants of grafts can find a destination...
737 $ hg log -r 'destination(7)'
737 $ hg log -r 'destination(7)'
738 changeset: 21:7e61b508e709
738 changeset: 21:7e61b508e709
739 branch: dev
739 branch: dev
740 tag: tip
740 tag: tip
741 user: foo
741 user: foo
742 date: Thu Jan 01 00:00:00 1970 +0000
742 date: Thu Jan 01 00:00:00 1970 +0000
743 summary: 2
743 summary: 2
744
744
745 ... grafts of grafts unfortunately can't
745 ... grafts of grafts unfortunately can't
746 $ hg graft -q 13 --debug
746 $ hg graft -q 13 --debug
747 scanning for duplicate grafts
747 scanning for duplicate grafts
748 grafting 13:7a4785234d87 "2"
748 grafting 13:7a4785234d87 "2"
749 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
749 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
750 src: 'a' -> dst: 'b' *
750 src: 'a' -> dst: 'b' *
751 checking for directory renames
751 checking for directory renames
752 resolving manifests
752 resolving manifests
753 branchmerge: True, force: True, partial: False
753 branchmerge: True, force: True, partial: False
754 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
754 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
755 starting 4 threads for background file closing (?)
755 starting 4 threads for background file closing (?)
756 committing files:
756 committing files:
757 b
757 b
758 warning: can't find ancestor for 'b' copied from 'a'!
758 warning: can't find ancestor for 'b' copied from 'a'!
759 reusing manifest from p1 (listed files actually unchanged)
759 reusing manifest from p1 (listed files actually unchanged)
760 committing changelog
760 committing changelog
761 updating the branch cache
761 updating the branch cache
762 $ hg log -r 'destination(13)'
762 $ hg log -r 'destination(13)'
763 All copies of a cset
763 All copies of a cset
764 $ hg log -r 'origin(13) or destination(origin(13))'
764 $ hg log -r 'origin(13) or destination(origin(13))'
765 changeset: 2:5c095ad7e90f
765 changeset: 2:5c095ad7e90f
766 user: test
766 user: test
767 date: Thu Jan 01 00:00:00 1970 +0000
767 date: Thu Jan 01 00:00:00 1970 +0000
768 summary: 2
768 summary: 2
769
769
770 changeset: 7:ef0ef43d49e7
770 changeset: 7:ef0ef43d49e7
771 parent: 0:68795b066622
771 parent: 0:68795b066622
772 user: foo
772 user: foo
773 date: Thu Jan 01 00:00:00 1970 +0000
773 date: Thu Jan 01 00:00:00 1970 +0000
774 summary: 2
774 summary: 2
775
775
776 changeset: 13:7a4785234d87
776 changeset: 13:7a4785234d87
777 user: foo
777 user: foo
778 date: Thu Jan 01 00:00:00 1970 +0000
778 date: Thu Jan 01 00:00:00 1970 +0000
779 summary: 2
779 summary: 2
780
780
781 changeset: 19:9627f653b421
781 changeset: 19:9627f653b421
782 user: test
782 user: test
783 date: Thu Jan 01 00:00:00 1970 +0000
783 date: Thu Jan 01 00:00:00 1970 +0000
784 summary: 2
784 summary: 2
785
785
786 changeset: 21:7e61b508e709
786 changeset: 21:7e61b508e709
787 branch: dev
787 branch: dev
788 user: foo
788 user: foo
789 date: Thu Jan 01 00:00:00 1970 +0000
789 date: Thu Jan 01 00:00:00 1970 +0000
790 summary: 2
790 summary: 2
791
791
792 changeset: 22:3a4e92d81b97
792 changeset: 22:3a4e92d81b97
793 branch: dev
793 branch: dev
794 tag: tip
794 tag: tip
795 user: foo
795 user: foo
796 date: Thu Jan 01 00:00:00 1970 +0000
796 date: Thu Jan 01 00:00:00 1970 +0000
797 summary: 2
797 summary: 2
798
798
799
799
800 graft works on complex revset
800 graft works on complex revset
801
801
802 $ hg graft 'origin(13) or destination(origin(13))'
802 $ hg graft 'origin(13) or destination(origin(13))'
803 skipping ancestor revision 21:7e61b508e709
803 skipping ancestor revision 21:7e61b508e709
804 skipping ancestor revision 22:3a4e92d81b97
804 skipping ancestor revision 22:3a4e92d81b97
805 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
805 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
806 grafting 7:ef0ef43d49e7 "2"
806 grafting 7:ef0ef43d49e7 "2"
807 warning: can't find ancestor for 'b' copied from 'a'!
807 warning: can't find ancestor for 'b' copied from 'a'!
808 grafting 13:7a4785234d87 "2"
808 grafting 13:7a4785234d87 "2"
809 warning: can't find ancestor for 'b' copied from 'a'!
809 warning: can't find ancestor for 'b' copied from 'a'!
810 grafting 19:9627f653b421 "2"
810 grafting 19:9627f653b421 "2"
811 merging b
811 merging b
812 warning: can't find ancestor for 'b' copied from 'a'!
812 warning: can't find ancestor for 'b' copied from 'a'!
813
813
814 graft with --force (still doesn't graft merges)
814 graft with --force (still doesn't graft merges)
815
815
816 $ hg graft 19 0 6
816 $ hg graft 19 0 6
817 skipping ungraftable merge revision 6
817 skipping ungraftable merge revision 6
818 skipping ancestor revision 0:68795b066622
818 skipping ancestor revision 0:68795b066622
819 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
819 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
820 [255]
820 [255]
821 $ hg graft 19 0 6 --force
821 $ hg graft 19 0 6 --force
822 skipping ungraftable merge revision 6
822 skipping ungraftable merge revision 6
823 grafting 19:9627f653b421 "2"
823 grafting 19:9627f653b421 "2"
824 merging b
824 merging b
825 warning: can't find ancestor for 'b' copied from 'a'!
825 warning: can't find ancestor for 'b' copied from 'a'!
826 grafting 0:68795b066622 "0"
826 grafting 0:68795b066622 "0"
827
827
828 graft --force after backout
828 graft --force after backout
829
829
830 $ echo abc > a
830 $ echo abc > a
831 $ hg ci -m 28
831 $ hg ci -m 28
832 $ hg backout 28
832 $ hg backout 28
833 reverting a
833 reverting a
834 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
834 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
835 $ hg graft 28
835 $ hg graft 28
836 skipping ancestor revision 28:cc20d29aec8d
836 skipping ancestor revision 28:cc20d29aec8d
837 [255]
837 [255]
838 $ hg graft 28 --force
838 $ hg graft 28 --force
839 grafting 28:cc20d29aec8d "28"
839 grafting 28:cc20d29aec8d "28"
840 merging a
840 merging a
841 $ cat a
841 $ cat a
842 abc
842 abc
843
843
844 graft --continue after --force
844 graft --continue after --force
845
845
846 $ echo def > a
846 $ echo def > a
847 $ hg ci -m 31
847 $ hg ci -m 31
848 $ hg graft 28 --force --tool internal:fail
848 $ hg graft 28 --force --tool internal:fail
849 grafting 28:cc20d29aec8d "28"
849 grafting 28:cc20d29aec8d "28"
850 abort: unresolved conflicts, can't continue
850 abort: unresolved conflicts, can't continue
851 (use 'hg resolve' and 'hg graft --continue')
851 (use 'hg resolve' and 'hg graft --continue')
852 [255]
852 [255]
853 $ hg resolve --all
853 $ hg resolve --all
854 merging a
854 merging a
855 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
855 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
856 [1]
856 [1]
857 $ echo abc > a
857 $ echo abc > a
858 $ hg resolve -m a
858 $ hg resolve -m a
859 (no more unresolved files)
859 (no more unresolved files)
860 continue: hg graft --continue
860 continue: hg graft --continue
861 $ hg graft -c
861 $ hg graft -c
862 grafting 28:cc20d29aec8d "28"
862 grafting 28:cc20d29aec8d "28"
863 $ cat a
863 $ cat a
864 abc
864 abc
865
865
866 Continue testing same origin policy, using revision numbers from test above
866 Continue testing same origin policy, using revision numbers from test above
867 but do some destructive editing of the repo:
867 but do some destructive editing of the repo:
868
868
869 $ hg up -qC 7
869 $ hg up -qC 7
870 $ hg tag -l -r 13 tmp
870 $ hg tag -l -r 13 tmp
871 $ hg --config extensions.strip= strip 2
871 $ hg --config extensions.strip= strip 2
872 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
872 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
873 $ hg graft tmp
873 $ hg graft tmp
874 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
874 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
875 [255]
875 [255]
876
876
877 Empty graft
877 Empty graft
878
878
879 $ hg up -qr 26
879 $ hg up -qr 26
880 $ hg tag -f something
880 $ hg tag -f something
881 $ hg graft -qr 27
881 $ hg graft -qr 27
882 $ hg graft -f 27
882 $ hg graft -f 27
883 grafting 27:17d42b8f5d50 "28"
883 grafting 27:17d42b8f5d50 "28"
884 note: graft of 27:17d42b8f5d50 created no changes to commit
884 note: graft of 27:17d42b8f5d50 created no changes to commit
885
885
886 $ cd ..
886 $ cd ..
887
887
888 Graft to duplicate a commit
888 Graft to duplicate a commit
889
889
890 $ hg init graftsibling
890 $ hg init graftsibling
891 $ cd graftsibling
891 $ cd graftsibling
892 $ touch a
892 $ touch a
893 $ hg commit -qAm a
893 $ hg commit -qAm a
894 $ touch b
894 $ touch b
895 $ hg commit -qAm b
895 $ hg commit -qAm b
896 $ hg log -G -T '{rev}\n'
896 $ hg log -G -T '{rev}\n'
897 @ 1
897 @ 1
898 |
898 |
899 o 0
899 o 0
900
900
901 $ hg up -q 0
901 $ hg up -q 0
902 $ hg graft -r 1
902 $ hg graft -r 1
903 grafting 1:0e067c57feba "b" (tip)
903 grafting 1:0e067c57feba "b" (tip)
904 $ hg log -G -T '{rev}\n'
904 $ hg log -G -T '{rev}\n'
905 @ 2
905 @ 2
906 |
906 |
907 | o 1
907 | o 1
908 |/
908 |/
909 o 0
909 o 0
910
910
911 Graft to duplicate a commit twice
911 Graft to duplicate a commit twice
912
912
913 $ hg up -q 0
913 $ hg up -q 0
914 $ hg graft -r 2
914 $ hg graft -r 2
915 grafting 2:044ec77f6389 "b" (tip)
915 grafting 2:044ec77f6389 "b" (tip)
916 $ hg log -G -T '{rev}\n'
916 $ hg log -G -T '{rev}\n'
917 @ 3
917 @ 3
918 |
918 |
919 | o 2
919 | o 2
920 |/
920 |/
921 | o 1
921 | o 1
922 |/
922 |/
923 o 0
923 o 0
924
924
925 Graft from behind a move or rename
926 ==================================
927
928 NOTE: This is affected by issue5343, and will need updating when it's fixed
929
930 Consider this topology for a regular graft:
931
932 o c1
933 |
934 | o c2
935 | |
936 | o ca # stands for "common ancestor"
937 |/
938 o cta # stands for "common topological ancestor"
939
940 Note that in issue5343, ca==cta.
941
942 The following table shows the possible cases. Here, "x->y" and, equivalently,
943 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
944
945 name | c1<-cta | cta<->ca | ca->c2
946 A.0 | | |
947 A.1 | X | |
948 A.2 | | X |
949 A.3 | | | X
950 A.4 | X | X |
951 A.5 | X | | X
952 A.6 | | X | X
953 A.7 | X | X | X
954
955 A.0 is trivial, and doesn't need copy tracking.
956 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
957 In A.2, the rename is recorded in the c2 pass and followed backwards.
958 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
959 In A.4, both passes of checkcopies record incomplete renames, which are
960 then joined in mergecopies to record a rename to be followed.
961 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
962 records an incomplete divergence. The incomplete rename is then joined to the
963 appropriate side of the incomplete divergence, and the result is recorded as a
964 divergence. The code doesn't distinguish at all between these two cases, since
965 the end result of them is the same: an incomplete divergence joined with an
966 incomplete rename into a divergence.
967 Finally, A.6 records a divergence entirely in the c2 pass.
968
969 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
970 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
971 A.5 has issue5343 as a special case.
972 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
973 incomplete divergence, which is in fact complete. This is handled later in
974 mergecopies.
975 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
976 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
977 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
978 case, a<-b<-c->a is treated the same as a<-b<-b->a).
979
980 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
981 same name on both branches, then the rename is backed out on one branch, and
982 the backout is grafted to the other branch. This creates a challenging rename
983 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
984 source, respectively. Since rename detection will run on the c1 side for such a
985 sequence (as for technical reasons, we split the c1 and c2 sides not at the
986 graft CA, but rather at the topological CA), it will pick up a false rename,
987 and cause a spurious merge conflict. This false rename is always exactly the
988 reverse of the true rename that would be detected on the c2 side, so we can
989 correct for it by detecting this condition and reversing as necessary.
990
991 First, set up the repository with commits to be grafted
992
993 $ hg init ../graftmove
994 $ cd ../graftmove
995 $ echo c1a > f1a
996 $ echo c2a > f2a
997 $ echo c3a > f3a
998 $ echo c4a > f4a
999 $ echo c5a > f5a
1000 $ hg ci -qAm A0
1001 $ hg mv f1a f1b
1002 $ hg mv f3a f3b
1003 $ hg mv f5a f5b
1004 $ hg ci -qAm B0
1005 $ echo c1c > f1b
1006 $ hg mv f2a f2c
1007 $ hg mv f5b f5a
1008 $ echo c5c > f5a
1009 $ hg ci -qAm C0
1010 $ hg mv f3b f3d
1011 $ echo c4d > f4a
1012 $ hg ci -qAm D0
1013 $ hg log -G
1014 @ changeset: 3:b69f5839d2d9
1015 | tag: tip
1016 | user: test
1017 | date: Thu Jan 01 00:00:00 1970 +0000
1018 | summary: D0
1019 |
1020 o changeset: 2:f58c7e2b28fa
1021 | user: test
1022 | date: Thu Jan 01 00:00:00 1970 +0000
1023 | summary: C0
1024 |
1025 o changeset: 1:3d7bba921b5d
1026 | user: test
1027 | date: Thu Jan 01 00:00:00 1970 +0000
1028 | summary: B0
1029 |
1030 o changeset: 0:11f7a1b56675
1031 user: test
1032 date: Thu Jan 01 00:00:00 1970 +0000
1033 summary: A0
1034
1035
1036 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1037 two renames actually converge to the same name (thus no actual divergence).
1038
1039 $ hg up -q 'desc("A0")'
1040 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1041 grafting 2:f58c7e2b28fa "C0"
1042 merging f1a and f1b to f1a
1043 merging f5a
1044 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1045 $ hg status --change .
1046 M f1a
1047 M f5a
1048 A f2c
1049 R f2a
1050 $ hg cat f1a
1051 c1c
1052 $ hg cat f1b
1053 f1b: no such file in rev c9763722f9bd
1054 [1]
1055
1056 Test the cases A.0 (f4x) and A.6 (f3x)
1057
1058 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1059 grafting 3:b69f5839d2d9 "D0"
1060 note: possible conflict - f3b was renamed multiple times to:
1061 f3a
1062 f3d
1063 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1064
1065 Set up the repository for some further tests
1066
1067 $ hg up -q "min(desc("A0"))"
1068 $ hg mv f1a f1e
1069 $ echo c2e > f2a
1070 $ hg mv f3a f3e
1071 $ hg mv f4a f4e
1072 $ hg mv f5a f5b
1073 $ hg ci -qAm "E0"
1074 $ hg up -q "min(desc("A0"))"
1075 $ hg cp f1a f1f
1076 $ hg ci -qAm "F0"
1077 $ hg up -q "min(desc("A0"))"
1078 $ hg cp f1a f1g
1079 $ echo c1g > f1g
1080 $ hg ci -qAm "G0"
1081 $ hg log -G
1082 @ changeset: 8:ba67f08fb15a
1083 | tag: tip
1084 | parent: 0:11f7a1b56675
1085 | user: test
1086 | date: Thu Jan 01 00:00:00 1970 +0000
1087 | summary: G0
1088 |
1089 | o changeset: 7:d376ab0d7fda
1090 |/ parent: 0:11f7a1b56675
1091 | user: test
1092 | date: Thu Jan 01 00:00:00 1970 +0000
1093 | summary: F0
1094 |
1095 | o changeset: 6:6bd1736cab86
1096 |/ parent: 0:11f7a1b56675
1097 | user: test
1098 | date: Thu Jan 01 00:00:00 1970 +0000
1099 | summary: E0
1100 |
1101 | o changeset: 5:560daee679da
1102 | | user: test
1103 | | date: Thu Jan 01 00:00:00 1970 +0000
1104 | | summary: D1
1105 | |
1106 | o changeset: 4:c9763722f9bd
1107 |/ parent: 0:11f7a1b56675
1108 | user: test
1109 | date: Thu Jan 01 00:00:00 1970 +0000
1110 | summary: C1
1111 |
1112 | o changeset: 3:b69f5839d2d9
1113 | | user: test
1114 | | date: Thu Jan 01 00:00:00 1970 +0000
1115 | | summary: D0
1116 | |
1117 | o changeset: 2:f58c7e2b28fa
1118 | | user: test
1119 | | date: Thu Jan 01 00:00:00 1970 +0000
1120 | | summary: C0
1121 | |
1122 | o changeset: 1:3d7bba921b5d
1123 |/ user: test
1124 | date: Thu Jan 01 00:00:00 1970 +0000
1125 | summary: B0
1126 |
1127 o changeset: 0:11f7a1b56675
1128 user: test
1129 date: Thu Jan 01 00:00:00 1970 +0000
1130 summary: A0
1131
1132
1133 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1134 and A.3 with a local content change to be preserved (f2x).
1135
1136 $ hg up -q "desc("E0")"
1137 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1138 grafting 2:f58c7e2b28fa "C0"
1139 merging f1e and f1b to f1e
1140 merging f2a and f2c to f2c
1141
1142 Test the cases A.1 (f4x) and A.7 (f3x).
1143
1144 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1145 grafting 3:b69f5839d2d9 "D0"
1146 note: possible conflict - f3b was renamed multiple times to:
1147 f3d
1148 f3e
1149 merging f4e and f4a to f4e
1150 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1151
1152 $ hg cat f2c
1153 c2e
1154
1155 Test the case A.5 (move case, f1x).
1156
1157 $ hg up -q "desc("C0")"
1158 BROKEN: Shouldn't get the warning about missing ancestor
1159 $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit
1160 grafting 6:6bd1736cab86 "E0"
1161 note: possible conflict - f1a was renamed multiple times to:
1162 f1b
1163 f1e
1164 note: possible conflict - f3a was renamed multiple times to:
1165 f3b
1166 f3e
1167 merging f2c and f2a to f2c
1168 merging f5a and f5b to f5b
1169 warning: can't find ancestor for 'f1e' copied from 'f1a'!
1170 warning: can't find ancestor for 'f3e' copied from 'f3a'!
1171 $ cat f1e
1172 c1a
1173
1174 Test the case A.5 (copy case, f1x).
1175
1176 $ hg up -q "desc("C0")"
1177 BROKEN: Shouldn't get the warning about missing ancestor
1178 $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit
1179 grafting 7:d376ab0d7fda "F0"
1180 warning: can't find ancestor for 'f1f' copied from 'f1a'!
1181 BROKEN: f1f should be marked a copy from f1b
1182 $ hg st --copies --change .
1183 A f1f
1184 BROKEN: f1f should have the new content from f1b (i.e. "c1c")
1185 $ cat f1f
1186 c1a
1187
1188 Test the case A.5 (copy+modify case, f1x).
1189
1190 $ hg up -q "desc("C0")"
1191 BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0
1192 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content
1193 "c1a")
1194 $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit
1195 grafting 8:ba67f08fb15a "G0"
1196 warning: can't find ancestor for 'f1g' copied from 'f1a'!
1197
1198 Check the results of the grafts tested
1199
1200 $ hg log -CGv --patch --git
1201 @ changeset: 13:ef3adf6c20a4
1202 | tag: tip
1203 | parent: 2:f58c7e2b28fa
1204 | user: test
1205 | date: Thu Jan 01 00:00:00 1970 +0000
1206 | files: f1g
1207 | description:
1208 | G1
1209 |
1210 |
1211 | diff --git a/f1g b/f1g
1212 | new file mode 100644
1213 | --- /dev/null
1214 | +++ b/f1g
1215 | @@ -0,0 +1,1 @@
1216 | +c1g
1217 |
1218 | o changeset: 12:b5542d755b54
1219 |/ parent: 2:f58c7e2b28fa
1220 | user: test
1221 | date: Thu Jan 01 00:00:00 1970 +0000
1222 | files: f1f
1223 | description:
1224 | F1
1225 |
1226 |
1227 | diff --git a/f1f b/f1f
1228 | new file mode 100644
1229 | --- /dev/null
1230 | +++ b/f1f
1231 | @@ -0,0 +1,1 @@
1232 | +c1a
1233 |
1234 | o changeset: 11:f8a162271246
1235 |/ parent: 2:f58c7e2b28fa
1236 | user: test
1237 | date: Thu Jan 01 00:00:00 1970 +0000
1238 | files: f1e f2c f3e f4a f4e f5a f5b
1239 | copies: f4e (f4a) f5b (f5a)
1240 | description:
1241 | E1
1242 |
1243 |
1244 | diff --git a/f1e b/f1e
1245 | new file mode 100644
1246 | --- /dev/null
1247 | +++ b/f1e
1248 | @@ -0,0 +1,1 @@
1249 | +c1a
1250 | diff --git a/f2c b/f2c
1251 | --- a/f2c
1252 | +++ b/f2c
1253 | @@ -1,1 +1,1 @@
1254 | -c2a
1255 | +c2e
1256 | diff --git a/f3e b/f3e
1257 | new file mode 100644
1258 | --- /dev/null
1259 | +++ b/f3e
1260 | @@ -0,0 +1,1 @@
1261 | +c3a
1262 | diff --git a/f4a b/f4e
1263 | rename from f4a
1264 | rename to f4e
1265 | diff --git a/f5a b/f5b
1266 | rename from f5a
1267 | rename to f5b
1268 |
1269 | o changeset: 10:93ee502e8b0a
1270 | | user: test
1271 | | date: Thu Jan 01 00:00:00 1970 +0000
1272 | | files: f3d f4e
1273 | | description:
1274 | | D2
1275 | |
1276 | |
1277 | | diff --git a/f3d b/f3d
1278 | | new file mode 100644
1279 | | --- /dev/null
1280 | | +++ b/f3d
1281 | | @@ -0,0 +1,1 @@
1282 | | +c3a
1283 | | diff --git a/f4e b/f4e
1284 | | --- a/f4e
1285 | | +++ b/f4e
1286 | | @@ -1,1 +1,1 @@
1287 | | -c4a
1288 | | +c4d
1289 | |
1290 | o changeset: 9:539cf145f496
1291 | | parent: 6:6bd1736cab86
1292 | | user: test
1293 | | date: Thu Jan 01 00:00:00 1970 +0000
1294 | | files: f1e f2a f2c f5a f5b
1295 | | copies: f2c (f2a) f5a (f5b)
1296 | | description:
1297 | | C2
1298 | |
1299 | |
1300 | | diff --git a/f1e b/f1e
1301 | | --- a/f1e
1302 | | +++ b/f1e
1303 | | @@ -1,1 +1,1 @@
1304 | | -c1a
1305 | | +c1c
1306 | | diff --git a/f2a b/f2c
1307 | | rename from f2a
1308 | | rename to f2c
1309 | | diff --git a/f5b b/f5a
1310 | | rename from f5b
1311 | | rename to f5a
1312 | | --- a/f5b
1313 | | +++ b/f5a
1314 | | @@ -1,1 +1,1 @@
1315 | | -c5a
1316 | | +c5c
1317 | |
1318 | | o changeset: 8:ba67f08fb15a
1319 | | | parent: 0:11f7a1b56675
1320 | | | user: test
1321 | | | date: Thu Jan 01 00:00:00 1970 +0000
1322 | | | files: f1g
1323 | | | copies: f1g (f1a)
1324 | | | description:
1325 | | | G0
1326 | | |
1327 | | |
1328 | | | diff --git a/f1a b/f1g
1329 | | | copy from f1a
1330 | | | copy to f1g
1331 | | | --- a/f1a
1332 | | | +++ b/f1g
1333 | | | @@ -1,1 +1,1 @@
1334 | | | -c1a
1335 | | | +c1g
1336 | | |
1337 | | | o changeset: 7:d376ab0d7fda
1338 | | |/ parent: 0:11f7a1b56675
1339 | | | user: test
1340 | | | date: Thu Jan 01 00:00:00 1970 +0000
1341 | | | files: f1f
1342 | | | copies: f1f (f1a)
1343 | | | description:
1344 | | | F0
1345 | | |
1346 | | |
1347 | | | diff --git a/f1a b/f1f
1348 | | | copy from f1a
1349 | | | copy to f1f
1350 | | |
1351 | o | changeset: 6:6bd1736cab86
1352 | |/ parent: 0:11f7a1b56675
1353 | | user: test
1354 | | date: Thu Jan 01 00:00:00 1970 +0000
1355 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1356 | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1357 | | description:
1358 | | E0
1359 | |
1360 | |
1361 | | diff --git a/f1a b/f1e
1362 | | rename from f1a
1363 | | rename to f1e
1364 | | diff --git a/f2a b/f2a
1365 | | --- a/f2a
1366 | | +++ b/f2a
1367 | | @@ -1,1 +1,1 @@
1368 | | -c2a
1369 | | +c2e
1370 | | diff --git a/f3a b/f3e
1371 | | rename from f3a
1372 | | rename to f3e
1373 | | diff --git a/f4a b/f4e
1374 | | rename from f4a
1375 | | rename to f4e
1376 | | diff --git a/f5a b/f5b
1377 | | rename from f5a
1378 | | rename to f5b
1379 | |
1380 | | o changeset: 5:560daee679da
1381 | | | user: test
1382 | | | date: Thu Jan 01 00:00:00 1970 +0000
1383 | | | files: f3d f4a
1384 | | | description:
1385 | | | D1
1386 | | |
1387 | | |
1388 | | | diff --git a/f3d b/f3d
1389 | | | new file mode 100644
1390 | | | --- /dev/null
1391 | | | +++ b/f3d
1392 | | | @@ -0,0 +1,1 @@
1393 | | | +c3a
1394 | | | diff --git a/f4a b/f4a
1395 | | | --- a/f4a
1396 | | | +++ b/f4a
1397 | | | @@ -1,1 +1,1 @@
1398 | | | -c4a
1399 | | | +c4d
1400 | | |
1401 | | o changeset: 4:c9763722f9bd
1402 | |/ parent: 0:11f7a1b56675
1403 | | user: test
1404 | | date: Thu Jan 01 00:00:00 1970 +0000
1405 | | files: f1a f2a f2c f5a
1406 | | copies: f2c (f2a)
1407 | | description:
1408 | | C1
1409 | |
1410 | |
1411 | | diff --git a/f1a b/f1a
1412 | | --- a/f1a
1413 | | +++ b/f1a
1414 | | @@ -1,1 +1,1 @@
1415 | | -c1a
1416 | | +c1c
1417 | | diff --git a/f2a b/f2c
1418 | | rename from f2a
1419 | | rename to f2c
1420 | | diff --git a/f5a b/f5a
1421 | | --- a/f5a
1422 | | +++ b/f5a
1423 | | @@ -1,1 +1,1 @@
1424 | | -c5a
1425 | | +c5c
1426 | |
1427 +---o changeset: 3:b69f5839d2d9
1428 | | user: test
1429 | | date: Thu Jan 01 00:00:00 1970 +0000
1430 | | files: f3b f3d f4a
1431 | | copies: f3d (f3b)
1432 | | description:
1433 | | D0
1434 | |
1435 | |
1436 | | diff --git a/f3b b/f3d
1437 | | rename from f3b
1438 | | rename to f3d
1439 | | diff --git a/f4a b/f4a
1440 | | --- a/f4a
1441 | | +++ b/f4a
1442 | | @@ -1,1 +1,1 @@
1443 | | -c4a
1444 | | +c4d
1445 | |
1446 o | changeset: 2:f58c7e2b28fa
1447 | | user: test
1448 | | date: Thu Jan 01 00:00:00 1970 +0000
1449 | | files: f1b f2a f2c f5a f5b
1450 | | copies: f2c (f2a) f5a (f5b)
1451 | | description:
1452 | | C0
1453 | |
1454 | |
1455 | | diff --git a/f1b b/f1b
1456 | | --- a/f1b
1457 | | +++ b/f1b
1458 | | @@ -1,1 +1,1 @@
1459 | | -c1a
1460 | | +c1c
1461 | | diff --git a/f2a b/f2c
1462 | | rename from f2a
1463 | | rename to f2c
1464 | | diff --git a/f5b b/f5a
1465 | | rename from f5b
1466 | | rename to f5a
1467 | | --- a/f5b
1468 | | +++ b/f5a
1469 | | @@ -1,1 +1,1 @@
1470 | | -c5a
1471 | | +c5c
1472 | |
1473 o | changeset: 1:3d7bba921b5d
1474 |/ user: test
1475 | date: Thu Jan 01 00:00:00 1970 +0000
1476 | files: f1a f1b f3a f3b f5a f5b
1477 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1478 | description:
1479 | B0
1480 |
1481 |
1482 | diff --git a/f1a b/f1b
1483 | rename from f1a
1484 | rename to f1b
1485 | diff --git a/f3a b/f3b
1486 | rename from f3a
1487 | rename to f3b
1488 | diff --git a/f5a b/f5b
1489 | rename from f5a
1490 | rename to f5b
1491 |
1492 o changeset: 0:11f7a1b56675
1493 user: test
1494 date: Thu Jan 01 00:00:00 1970 +0000
1495 files: f1a f2a f3a f4a f5a
1496 description:
1497 A0
1498
1499
1500 diff --git a/f1a b/f1a
1501 new file mode 100644
1502 --- /dev/null
1503 +++ b/f1a
1504 @@ -0,0 +1,1 @@
1505 +c1a
1506 diff --git a/f2a b/f2a
1507 new file mode 100644
1508 --- /dev/null
1509 +++ b/f2a
1510 @@ -0,0 +1,1 @@
1511 +c2a
1512 diff --git a/f3a b/f3a
1513 new file mode 100644
1514 --- /dev/null
1515 +++ b/f3a
1516 @@ -0,0 +1,1 @@
1517 +c3a
1518 diff --git a/f4a b/f4a
1519 new file mode 100644
1520 --- /dev/null
1521 +++ b/f4a
1522 @@ -0,0 +1,1 @@
1523 +c4a
1524 diff --git a/f5a b/f5a
1525 new file mode 100644
1526 --- /dev/null
1527 +++ b/f5a
1528 @@ -0,0 +1,1 @@
1529 +c5a
1530
1531 Check superfluous filemerge of files renamed in the past but untouched by graft
1532
1533 $ echo a > a
1534 $ hg ci -qAma
1535 $ hg mv a b
1536 $ echo b > b
1537 $ hg ci -qAmb
1538 $ echo c > c
1539 $ hg ci -qAmc
1540 $ hg up -q .~2
1541 $ hg graft tip -qt:fail
1542
1543 $ cd ..
1544
1545 Graft a change into a new file previously grafted into a renamed directory
1546
1547 $ hg init dirmovenewfile
1548 $ cd dirmovenewfile
1549 $ mkdir a
1550 $ echo a > a/a
1551 $ hg ci -qAma
1552 $ echo x > a/x
1553 $ hg ci -qAmx
1554 $ hg up -q 0
1555 $ hg mv -q a b
1556 $ hg ci -qAmb
1557 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1558 $ hg up -q 1
1559 $ echo y > a/x
1560 $ hg ci -qAmy
1561 $ hg up -q 3
1562 $ hg graft -q 4
1563 $ hg status --change .
1564 M b/x
1565
1566 Prepare for test of skipped changesets and how merges can influence it:
1567
1568 $ hg merge -q -r 1 --tool :local
1569 $ hg ci -m m
1570 $ echo xx >> b/x
1571 $ hg ci -m xx
1572
1573 $ hg log -G -T '{rev} {desc|firstline}'
1574 @ 7 xx
1575 |
1576 o 6 m
1577 |\
1578 | o 5 y
1579 | |
1580 +---o 4 y
1581 | |
1582 | o 3 x
1583 | |
1584 | o 2 b
1585 | |
1586 o | 1 x
1587 |/
1588 o 0 a
1589
1590 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1591
1592 $ hg up -qCr 4
1593 $ hg graft --tool :local -r 2::5
1594 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1595 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1596 grafting 2:42127f193bcd "b"
1597
1598 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1599 also detecting that both 3 and 5 should be skipped:
1600
1601 $ hg up -qCr 4
1602 $ hg graft --tool :local -r 2::7
1603 skipping ungraftable merge revision 6
1604 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1605 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1606 grafting 2:42127f193bcd "b"
1607 grafting 7:d3c3f2b38ecc "xx"
1608 note: graft of 7:d3c3f2b38ecc created no changes to commit
1609
1610 $ cd ..
1611
1612 Grafted revision should be warned and skipped only once. (issue6024)
1613
1614 $ mkdir issue6024
1615 $ cd issue6024
1616
1617 $ hg init base
1618 $ cd base
1619 $ touch x
1620 $ hg commit -qAminit
1621 $ echo a > x
1622 $ hg commit -mchange
1623 $ hg update -q 0
1624 $ hg graft -r 1
1625 grafting 1:a0b923c546aa "change" (tip)
1626 $ cd ..
1627
1628 $ hg clone -qr 2 base clone
1629 $ cd clone
1630 $ hg pull -q
1631 $ hg merge -q 2
1632 $ hg commit -mmerge
1633 $ hg update -q 0
1634 $ hg graft -r 1
1635 grafting 1:04fc6d444368 "change"
1636 $ hg update -q 3
1637 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1638 o 4:4e16 <- a0b9
1639 |
1640 | @ 3:f0ac <-
1641 | |\
1642 +---o 2:a0b9 <-
1643 | |
1644 | o 1:04fc <- a0b9
1645 |/
1646 o 0:7848 <-
1647
1648
1649 the source of rev 4 is an ancestor of the working parent, and was also
1650 grafted as rev 1. it should be stripped from the target revisions only once.
1651
1652 $ hg graft -r 4
1653 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1654 [255]
1655
1656 $ cd ../..
General Comments 0
You need to be logged in to leave comments. Login now