changeset 22369:897041f6b025

merge with stable
author Kevin Bullock <kbullock@ringworld.org>
date Sun, 07 Sep 2014 11:46:11 -0500
parents c5df4af17110 (current diff) 802dffd62de5 (diff)
children 45e02cfad4bd
files hgext/histedit.py tests/test-histedit-arguments.t
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Thu Sep 04 09:59:23 2014 -0400
+++ b/hgext/histedit.py	Sun Sep 07 11:46:11 2014 -0500
@@ -149,6 +149,7 @@
     pickle.dump # import now
 except ImportError:
     import pickle
+import errno
 import os
 import sys
 
@@ -761,7 +762,12 @@
 def readstate(repo):
     """Returns a tuple of (parentnode, rules, keep, topmost, replacements).
     """
-    fp = open(os.path.join(repo.path, 'histedit-state'))
+    try:
+        fp = open(os.path.join(repo.path, 'histedit-state'))
+    except IOError, err:
+        if err.errno != errno.ENOENT:
+            raise
+        raise util.Abort(_('no histedit in progress'))
     return pickle.load(fp)
 
 
--- a/tests/test-histedit-arguments.t	Thu Sep 04 09:59:23 2014 -0400
+++ b/tests/test-histedit-arguments.t	Sun Sep 07 11:46:11 2014 -0500
@@ -41,6 +41,16 @@
        one
   
 
+histedit --continue/--abort with no existing state
+--------------------------------------------------
+
+  $ hg histedit --continue
+  abort: no histedit in progress
+  [255]
+  $ hg histedit --abort
+  abort: no histedit in progress
+  [255]
+
 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
 --------------------------------------------------------------------