Mercurial > evolve
changeset 5971:3f9a5c910131
pick: move `continue` and `abort` blocks above for more clarity
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Wed, 03 Feb 2021 10:07:54 +0530 |
parents | 65d4e47d7f26 |
children | 656edde3a8ce |
files | hgext3rd/evolve/cmdrewrite.py |
diffstat | 1 files changed, 14 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/cmdrewrite.py Tue May 04 09:40:18 2021 -0700 +++ b/hgext3rd/evolve/cmdrewrite.py Wed Feb 03 10:07:54 2021 +0530 @@ -1412,7 +1412,20 @@ pickstate = state.cmdstate(repo, path=b'pickstate') pctx = repo[b'.'] - if not cont and not abort: + if cont: + if revs: + raise error.Abort(_(b"cannot specify both --continue and " + b"revision")) + if not pickstate: + raise error.Abort(_(b"no interrupted pick state exists")) + + pickstate.load() + orignode = pickstate[b'orignode'] + origctx = repo[orignode] + + elif abort: + return abortpick(ui, repo, pickstate) + else: cmdutil.bailifchanged(repo) revs = scmutil.revrange(repo, revs) if len(revs) > 1: @@ -1440,21 +1453,6 @@ pickstate.save() raise error.InterventionRequired(_(b"unresolved merge conflicts" b" (see hg help resolve)")) - - elif abort: - return abortpick(ui, repo, pickstate) - - else: - if revs: - raise error.Abort(_(b"cannot specify both --continue and " - b"revision")) - if not pickstate: - raise error.Abort(_(b"no interrupted pick state exists")) - - pickstate.load() - orignode = pickstate[b'orignode'] - origctx = repo[orignode] - overrides = {(b'phases', b'new-commit'): origctx.phase()} with repo.ui.configoverride(overrides, b'pick'): newnode = repo.commit(text=origctx.description(),