Show More
@@ -3054,6 +3054,7 b' def forget(ui, repo, *pats, **opts):' | |||||
3054 | ('c', 'continue', False, _('resume interrupted graft')), |
|
3054 | ('c', 'continue', False, _('resume interrupted graft')), | |
3055 | ('e', 'edit', False, _('invoke editor on commit messages')), |
|
3055 | ('e', 'edit', False, _('invoke editor on commit messages')), | |
3056 | ('', 'log', None, _('append graft info to log message')), |
|
3056 | ('', 'log', None, _('append graft info to log message')), | |
|
3057 | ('f', 'force', False, _('force graft')), | |||
3057 | ('D', 'currentdate', False, |
|
3058 | ('D', 'currentdate', False, | |
3058 | _('record the current date as commit date')), |
|
3059 | _('record the current date as commit date')), | |
3059 | ('U', 'currentuser', False, |
|
3060 | ('U', 'currentuser', False, | |
@@ -3077,6 +3078,10 b' def graft(ui, repo, *revs, **opts):' | |||||
3077 |
|
3078 | |||
3078 | (grafted from CHANGESETHASH) |
|
3079 | (grafted from CHANGESETHASH) | |
3079 |
|
3080 | |||
|
3081 | If --force is specified, revisions will be grafted even if they | |||
|
3082 | are already ancestors of or have been grafted to the destination. | |||
|
3083 | This is useful when the revisions have since been backed out. | |||
|
3084 | ||||
3080 | If a graft merge results in conflicts, the graft process is |
|
3085 | If a graft merge results in conflicts, the graft process is | |
3081 | interrupted so that the current merge can be manually resolved. |
|
3086 | interrupted so that the current merge can be manually resolved. | |
3082 | Once all conflicts are addressed, the graft process can be |
|
3087 | Once all conflicts are addressed, the graft process can be | |
@@ -3151,6 +3156,7 b' def graft(ui, repo, *revs, **opts):' | |||||
3151 | return -1 |
|
3156 | return -1 | |
3152 |
|
3157 | |||
3153 | # check for ancestors of dest branch |
|
3158 | # check for ancestors of dest branch | |
|
3159 | if not opts.get('force'): | |||
3154 | crev = repo['.'].rev() |
|
3160 | crev = repo['.'].rev() | |
3155 | ancestors = repo.changelog.ancestors([crev], inclusive=True) |
|
3161 | ancestors = repo.changelog.ancestors([crev], inclusive=True) | |
3156 | # Cannot use x.remove(y) on smart set, this has to be a list. |
|
3162 | # Cannot use x.remove(y) on smart set, this has to be a list. |
@@ -257,7 +257,7 b' Show all commands + options' | |||||
257 | debugsuccessorssets: |
|
257 | debugsuccessorssets: | |
258 | debugwalk: include, exclude |
|
258 | debugwalk: include, exclude | |
259 | debugwireargs: three, four, five, ssh, remotecmd, insecure |
|
259 | debugwireargs: three, four, five, ssh, remotecmd, insecure | |
260 | graft: rev, continue, edit, log, currentdate, currentuser, date, user, tool, dry-run |
|
260 | graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run | |
261 | grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude |
|
261 | grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude | |
262 | heads: rev, topo, active, closed, style, template |
|
262 | heads: rev, topo, active, closed, style, template | |
263 | help: extension, command, keyword |
|
263 | help: extension, command, keyword |
@@ -631,3 +631,33 b' graft works on complex revset' | |||||
631 | grafting revision 13 |
|
631 | grafting revision 13 | |
632 | grafting revision 19 |
|
632 | grafting revision 19 | |
633 | merging b |
|
633 | merging b | |
|
634 | ||||
|
635 | graft with --force (still doesn't graft merges) | |||
|
636 | ||||
|
637 | $ hg graft 19 0 6 | |||
|
638 | skipping ungraftable merge revision 6 | |||
|
639 | skipping ancestor revision 0 | |||
|
640 | skipping already grafted revision 19 (22 also has origin 2) | |||
|
641 | [255] | |||
|
642 | $ hg graft 19 0 6 --force | |||
|
643 | skipping ungraftable merge revision 6 | |||
|
644 | grafting revision 19 | |||
|
645 | merging b | |||
|
646 | grafting revision 0 | |||
|
647 | ||||
|
648 | graft --force after backout | |||
|
649 | ||||
|
650 | $ echo abc > a | |||
|
651 | $ hg ci -m 28 | |||
|
652 | $ hg backout 28 | |||
|
653 | reverting a | |||
|
654 | changeset 29:484c03b8dfa4 backs out changeset 28:6c56f0f7f033 | |||
|
655 | $ hg graft 28 | |||
|
656 | skipping ancestor revision 28 | |||
|
657 | [255] | |||
|
658 | $ hg graft 28 --force | |||
|
659 | grafting revision 28 | |||
|
660 | merging a | |||
|
661 | $ cat a | |||
|
662 | abc | |||
|
663 |
General Comments 0
You need to be logged in to leave comments.
Login now