comparison mercurial/cmdutil.py @ 38280:2ec44160165d

graft: add a new `--stop` flag to stop interrupted graft This patch adds a new flag `--stop` to `hg graft` command which stops the interrupted graft. The `--stop` flag takes back you to the last successful step i.e. it will keep your grafted commits, it will just clear the mergestate and interrupted graft state. The `--stop` is different from `--abort` flag as the latter also undoes all the work done till now which is sometimes not what the user wants. Suppose you grafted a lot of changesets, you encountered conflicts, you resolved them, did `hg graft --continue`, again encountered conflicts, continue, again encountered conflicts. Now you are tired of solving merge conflicts and want to resume this sometimes later. If you use the `--abort` functionality, it will strip your already grafted changesets, making you loose the work you have done resolving merge conflicts. A general goal related to this flag is to add this flag to `rebase` and `histedit` too. The evolve command already has this --stop flag. Tests are added for the new flag. .. feature:: `hg graft` now has a `--stop` flag to stop interrupted graft. Differential Revision: https://phab.mercurial-scm.org/D3668
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 28 May 2018 21:13:32 +0530
parents 0c7970d4e6b4
children 47f5454a30ed
comparison
equal deleted inserted replaced
38279:a8e7ea176437 38280:2ec44160165d
3171 # Since graft cannot be aborted, it is considered 'clearable' by update. 3171 # Since graft cannot be aborted, it is considered 'clearable' by update.
3172 # note: bisect is intentionally excluded 3172 # note: bisect is intentionally excluded
3173 # (state file, clearable, allowcommit, error, hint) 3173 # (state file, clearable, allowcommit, error, hint)
3174 unfinishedstates = [ 3174 unfinishedstates = [
3175 ('graftstate', True, False, _('graft in progress'), 3175 ('graftstate', True, False, _('graft in progress'),
3176 _("use 'hg graft --continue' or 'hg update' to abort")), 3176 _("use 'hg graft --continue' or 'hg graft --stop' to abort")),
3177 ('updatestate', True, False, _('last update was interrupted'), 3177 ('updatestate', True, False, _('last update was interrupted'),
3178 _("use 'hg update' to get a consistent checkout")) 3178 _("use 'hg update' to get a consistent checkout"))
3179 ] 3179 ]
3180 3180
3181 def checkunfinished(repo, commit=False): 3181 def checkunfinished(repo, commit=False):