hgext/histedit.py
changeset 27171 3028ea0aff46
parent 27170 4cff4c38c5cc
child 27200 62b9a87a365e
--- a/hgext/histedit.py	Wed Dec 02 07:40:42 2015 +0000
+++ b/hgext/histedit.py	Wed Dec 02 08:07:36 2015 +0000
@@ -829,6 +829,11 @@
         state.wlock = repo.wlock()
         state.lock = repo.lock()
         _histedit(ui, repo, state, *freeargs, **opts)
+    except error.Abort:
+        if repo.vfs.exists('histedit-last-edit.txt'):
+            ui.warn(_('warning: histedit rules saved '
+                      'to: .hg/histedit-last-edit.txt\n'))
+        raise
     finally:
         release(state.lock, state.wlock)
 
@@ -957,6 +962,8 @@
         cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)
 
+        if repo.vfs.exists('histedit-last-edit.txt'):
+            repo.vfs.unlink('histedit-last-edit.txt')
         topmost, empty = repo.dirstate.parents()
         if outg:
             if freeargs: