# HG changeset patch # User Sushil khanchi # Date 1612327074 -19800 # Node ID 3f9a5c910131010f518550387a4f27c79088c3ba # Parent 65d4e47d7f26b0e00c4560cdafb22ca7202dffb1 pick: move `continue` and `abort` blocks above for more clarity diff -r 65d4e47d7f26 -r 3f9a5c910131 hgext3rd/evolve/cmdrewrite.py --- 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(),