changeset 27084:383f10b67fd6

histedit: add abortdirty function Small helper function for aborting histedit when left with dirty working directory.
author Mateusz Kwapich <mitrandir@fb.com>
date Tue, 17 Nov 2015 17:53:52 -0800
parents 6d5d7ac41ef4
children d50ff8f4891f
files hgext/histedit.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Thu Nov 12 16:40:33 2015 -0800
+++ b/hgext/histedit.py	Tue Nov 17 17:53:52 2015 -0800
@@ -524,6 +524,12 @@
 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 @@
         if _isdirtywc(repo):
             actobj.continuedirty()
             if _isdirtywc(repo):
-                raise error.Abort(_("working copy still dirty"))
+                abortdirty()
 
         parentctx, replacements = actobj.continueclean()