Commit 842603d5 authored by Sushil Khanchi's avatar Sushil Khanchi 🐨
Browse files

pick: move `continue` and `abort` blocks above for more clarity

parent 65d4e47d7f26
......@@ -1412,7 +1412,20 @@ def cmdpick(ui, repo, *revs, **opts):
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 @@ def cmdpick(ui, repo, *revs, **opts):
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(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment