Commit 3f9a5c91 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 @@ ...@@ -1412,7 +1412,20 @@
pickstate = state.cmdstate(repo, path=b'pickstate') pickstate = state.cmdstate(repo, path=b'pickstate')
pctx = repo[b'.'] 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) cmdutil.bailifchanged(repo)
revs = scmutil.revrange(repo, revs) revs = scmutil.revrange(repo, revs)
if len(revs) > 1: if len(revs) > 1:
...@@ -1440,21 +1453,6 @@ ...@@ -1440,21 +1453,6 @@
pickstate.save() pickstate.save()
raise error.InterventionRequired(_(b"unresolved merge conflicts" raise error.InterventionRequired(_(b"unresolved merge conflicts"
b" (see hg help resolve)")) 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()} overrides = {(b'phases', b'new-commit'): origctx.phase()}
with repo.ui.configoverride(overrides, b'pick'): with repo.ui.configoverride(overrides, b'pick'):
newnode = repo.commit(text=origctx.description(), 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