changeset 27543:ff0e4c8e642d

histedit: limit mentioning histedit-last-edit.txt Before histedit-last-edit.txt would be mentioned for any failure. After, it should only be mentioned for failures relating to user input.
author timeless <timeless@mozdev.org>
date Fri, 11 Dec 2015 07:08:09 +0000
parents bf0900d3819c
children a4f008612727
files hgext/histedit.py
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Mon Dec 28 22:53:22 2015 +0000
+++ b/hgext/histedit.py	Fri Dec 11 07:08:09 2015 +0000
@@ -902,11 +902,6 @@
         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)
 
@@ -987,7 +982,7 @@
         actions = parserules(rules, state)
         ctxs = [repo[act.nodetoverify()] \
                 for act in state.actions if act.nodetoverify()]
-        verifyactions(actions, state, ctxs)
+        warnverifyactions(ui, repo, actions, state, ctxs)
         state.actions = actions
         state.write()
         return
@@ -1070,7 +1065,7 @@
             rules = f.read()
             f.close()
         actions = parserules(rules, state)
-        verifyactions(actions, state, ctxs)
+        warnverifyactions(ui, repo, actions, state, ctxs)
 
         parentctxnode = repo[root].parents()[0].node()
 
@@ -1222,6 +1217,15 @@
         actions.append(action)
     return actions
 
+def warnverifyactions(ui, repo, actions, state, ctxs):
+    try:
+        verifyactions(actions, state, ctxs)
+    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
+
 def verifyactions(actions, state, ctxs):
     """Verify that there exists exactly one action per given changeset and
     other constraints.