Read about our upcoming Code of Conduct on this issue

Commit fccf5e26 authored by Mateusz Kwapich's avatar Mateusz Kwapich
Browse files

histedit: add abortdirty function

Small helper function for aborting histedit when left with dirty working
directory.
parent 6d5d7ac41ef4
......@@ -524,6 +524,12 @@ def collapse(repo, first, last, commitopts, skipprompt=False):
def _isdirtywc(repo):
return repo[None].dirty(missing=True)
def abortdirty():
raise error.Abort(_('working copy has pending changes'),
hint=_('amend, commit, or revert them and run histedit '
'--continue, or abort with histedit --abort'))
class pick(histeditaction):
def run(self):
rulectx = self.repo[self.node]
......@@ -996,7 +1002,7 @@ def bootstrapcontinue(ui, state, opts):
if _isdirtywc(repo):
actobj.continuedirty()
if _isdirtywc(repo):
raise error.Abort(_("working copy still dirty"))
abortdirty()
parentctx, replacements = actobj.continueclean()
......
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