histedit: extracts _isdirtywc function
Checking if working copy is dirty was done in few places, this
patch extracts it in _isdirtywc procedure.
--- a/hgext/histedit.py Mon Nov 16 11:23:32 2015 -0800
+++ b/hgext/histedit.py Thu Nov 12 12:44:15 2015 +0100
@@ -502,6 +502,9 @@
editor=editor)
return repo.commitctx(new)
+def _isdirtywc(repo):
+ return repo[None].dirty(missing=True)
+
class pick(histeditaction):
def run(self):
rulectx = self.repo[self.node]
@@ -971,11 +974,9 @@
actobj = actiontable[action].fromrule(state, currentnode)
- s = repo.status()
- if s.modified or s.added or s.removed or s.deleted:
+ if _isdirtywc(repo):
actobj.continuedirty()
- s = repo.status()
- if s.modified or s.added or s.removed or s.deleted:
+ if _isdirtywc(repo):
raise error.Abort(_("working copy still dirty"))
parentctx, replacements = actobj.continueclean()