##// END OF EJS Templates
graft: record intermediate grafts in extras...
Durham Goode -
r24644:51930a71 default
parent child Browse files
Show More
@@ -3547,9 +3547,12 b' def graft(ui, repo, *revs, **opts):'
3547 continue
3547 continue
3548
3548
3549 source = ctx.extra().get('source')
3549 source = ctx.extra().get('source')
3550 if not source:
3550 extra = {}
3551 source = ctx.hex()
3551 if source:
3552 extra = {'source': source}
3552 extra['source'] = source
3553 extra['intermediate-source'] = ctx.hex()
3554 else:
3555 extra['source'] = ctx.hex()
3553 user = ctx.user()
3556 user = ctx.user()
3554 if opts.get('user'):
3557 if opts.get('user'):
3555 user = opts['user']
3558 user = opts['user']
@@ -313,7 +313,7 b' Graft again onto another branch should p'
313 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
313 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
314
314
315 $ hg log --debug -r tip
315 $ hg log --debug -r tip
316 changeset: 13:9db0f28fd3747e92c57d015f53b5593aeec53c2d
316 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
317 tag: tip
317 tag: tip
318 phase: draft
318 phase: draft
319 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
319 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
@@ -324,6 +324,7 b' Graft again onto another branch should p'
324 files+: b
324 files+: b
325 files-: a
325 files-: a
326 extra: branch=default
326 extra: branch=default
327 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
327 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
328 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
328 description:
329 description:
329 2
330 2
@@ -338,10 +339,10 b' Disallow grafting an already grafted cse'
338 Disallow grafting already grafted csets with the same origin onto each other
339 Disallow grafting already grafted csets with the same origin onto each other
339 $ hg up -q 13
340 $ hg up -q 13
340 $ hg graft 2
341 $ hg graft 2
341 skipping revision 2:5c095ad7e90f (already grafted to 13:9db0f28fd374)
342 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
342 [255]
343 [255]
343 $ hg graft 7
344 $ hg graft 7
344 skipping already grafted revision 7:ef0ef43d49e7 (13:9db0f28fd374 also has origin 2:5c095ad7e90f)
345 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
345 [255]
346 [255]
346
347
347 $ hg up -q 7
348 $ hg up -q 7
@@ -349,7 +350,7 b' Disallow grafting already grafted csets '
349 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
350 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
350 [255]
351 [255]
351 $ hg graft tip
352 $ hg graft tip
352 skipping already grafted revision 13:9db0f28fd374 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
353 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
353 [255]
354 [255]
354
355
355 Graft with --log
356 Graft with --log
@@ -543,7 +544,7 b' Test simple destination'
543 date: Thu Jan 01 00:00:00 1970 +0000
544 date: Thu Jan 01 00:00:00 1970 +0000
544 summary: 3
545 summary: 3
545
546
546 changeset: 13:9db0f28fd374
547 changeset: 13:7a4785234d87
547 user: foo
548 user: foo
548 date: Thu Jan 01 00:00:00 1970 +0000
549 date: Thu Jan 01 00:00:00 1970 +0000
549 summary: 2
550 summary: 2
@@ -578,7 +579,7 b' Test simple destination'
578 date: Thu Jan 01 00:00:00 1970 +0000
579 date: Thu Jan 01 00:00:00 1970 +0000
579 summary: 2
580 summary: 2
580
581
581 changeset: 13:9db0f28fd374
582 changeset: 13:7a4785234d87
582 user: foo
583 user: foo
583 date: Thu Jan 01 00:00:00 1970 +0000
584 date: Thu Jan 01 00:00:00 1970 +0000
584 summary: 2
585 summary: 2
@@ -621,7 +622,7 b' All copies of a cset'
621 date: Thu Jan 01 00:00:00 1970 +0000
622 date: Thu Jan 01 00:00:00 1970 +0000
622 summary: 2
623 summary: 2
623
624
624 changeset: 13:9db0f28fd374
625 changeset: 13:7a4785234d87
625 user: foo
626 user: foo
626 date: Thu Jan 01 00:00:00 1970 +0000
627 date: Thu Jan 01 00:00:00 1970 +0000
627 summary: 2
628 summary: 2
@@ -637,7 +638,7 b' All copies of a cset'
637 date: Thu Jan 01 00:00:00 1970 +0000
638 date: Thu Jan 01 00:00:00 1970 +0000
638 summary: 2
639 summary: 2
639
640
640 changeset: 22:e95864da75a0
641 changeset: 22:d1cb6591fa4b
641 branch: dev
642 branch: dev
642 tag: tip
643 tag: tip
643 user: foo
644 user: foo
@@ -649,11 +650,11 b' graft works on complex revset'
649
650
650 $ hg graft 'origin(13) or destination(origin(13))'
651 $ hg graft 'origin(13) or destination(origin(13))'
651 skipping ancestor revision 21:7e61b508e709
652 skipping ancestor revision 21:7e61b508e709
652 skipping ancestor revision 22:e95864da75a0
653 skipping ancestor revision 22:d1cb6591fa4b
653 skipping revision 2:5c095ad7e90f (already grafted to 22:e95864da75a0)
654 skipping revision 2:5c095ad7e90f (already grafted to 22:d1cb6591fa4b)
654 grafting 7:ef0ef43d49e7 "2"
655 grafting 7:ef0ef43d49e7 "2"
655 warning: can't find ancestor for 'b' copied from 'a'!
656 warning: can't find ancestor for 'b' copied from 'a'!
656 grafting 13:9db0f28fd374 "2"
657 grafting 13:7a4785234d87 "2"
657 warning: can't find ancestor for 'b' copied from 'a'!
658 warning: can't find ancestor for 'b' copied from 'a'!
658 grafting 19:9627f653b421 "2"
659 grafting 19:9627f653b421 "2"
659 merging b
660 merging b
@@ -664,7 +665,7 b" graft with --force (still doesn't graft "
664 $ hg graft 19 0 6
665 $ hg graft 19 0 6
665 skipping ungraftable merge revision 6
666 skipping ungraftable merge revision 6
666 skipping ancestor revision 0:68795b066622
667 skipping ancestor revision 0:68795b066622
667 skipping already grafted revision 19:9627f653b421 (22:e95864da75a0 also has origin 2:5c095ad7e90f)
668 skipping already grafted revision 19:9627f653b421 (22:d1cb6591fa4b also has origin 2:5c095ad7e90f)
668 [255]
669 [255]
669 $ hg graft 19 0 6 --force
670 $ hg graft 19 0 6 --force
670 skipping ungraftable merge revision 6
671 skipping ungraftable merge revision 6
@@ -679,12 +680,12 b' graft --force after backout'
679 $ hg ci -m 28
680 $ hg ci -m 28
680 $ hg backout 28
681 $ hg backout 28
681 reverting a
682 reverting a
682 changeset 29:8389853bba65 backs out changeset 28:cd42a33e1848
683 changeset 29:53177ba928f6 backs out changeset 28:50a516bb8b57
683 $ hg graft 28
684 $ hg graft 28
684 skipping ancestor revision 28:cd42a33e1848
685 skipping ancestor revision 28:50a516bb8b57
685 [255]
686 [255]
686 $ hg graft 28 --force
687 $ hg graft 28 --force
687 grafting 28:cd42a33e1848 "28"
688 grafting 28:50a516bb8b57 "28"
688 merging a
689 merging a
689 $ cat a
690 $ cat a
690 abc
691 abc
@@ -694,7 +695,7 b' graft --continue after --force'
694 $ echo def > a
695 $ echo def > a
695 $ hg ci -m 31
696 $ hg ci -m 31
696 $ hg graft 28 --force --tool internal:fail
697 $ hg graft 28 --force --tool internal:fail
697 grafting 28:cd42a33e1848 "28"
698 grafting 28:50a516bb8b57 "28"
698 abort: unresolved conflicts, can't continue
699 abort: unresolved conflicts, can't continue
699 (use hg resolve and hg graft --continue)
700 (use hg resolve and hg graft --continue)
700 [255]
701 [255]
@@ -707,7 +708,7 b' graft --continue after --force'
707 $ hg resolve -m a
708 $ hg resolve -m a
708 (no more unresolved files)
709 (no more unresolved files)
709 $ hg graft -c
710 $ hg graft -c
710 grafting 28:cd42a33e1848 "28"
711 grafting 28:50a516bb8b57 "28"
711 $ cat a
712 $ cat a
712 abc
713 abc
713
714
@@ -719,7 +720,7 b' but do some destructive editing of the r'
719 $ hg --config extensions.strip= strip 2
720 $ hg --config extensions.strip= strip 2
720 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg (glob)
721 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg (glob)
721 $ hg graft tmp
722 $ hg graft tmp
722 skipping already grafted revision 8:9db0f28fd374 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
723 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
723 [255]
724 [255]
724
725
725 Empty graft
726 Empty graft
@@ -728,8 +729,8 b' Empty graft'
728 $ hg tag -f something
729 $ hg tag -f something
729 $ hg graft -qr 27
730 $ hg graft -qr 27
730 $ hg graft -f 27
731 $ hg graft -f 27
731 grafting 27:3d35c4c79e5a "28"
732 grafting 27:ed6c7e54e319 "28"
732 note: graft of 27:3d35c4c79e5a created no changes to commit
733 note: graft of 27:ed6c7e54e319 created no changes to commit
733
734
734 $ cd ..
735 $ cd ..
735
736
@@ -756,3 +757,17 b' Graft to duplicate a commit'
756 |/
757 |/
757 o 0
758 o 0
758
759
760 Graft to duplicate a commit twice
761
762 $ hg up -q 0
763 $ hg graft -r 2
764 grafting 2:044ec77f6389 "b" (tip)
765 $ hg log -G -T '{rev}\n'
766 @ 3
767 |
768 | o 2
769 |/
770 | o 1
771 |/
772 o 0
773
General Comments 0
You need to be logged in to leave comments. Login now