##// END OF EJS Templates
histedit: abort gracefully on --continue/--abort with no state...
Siddharth Agarwal -
r22368:802dffd6 stable
parent child Browse files
Show More
@@ -147,6 +147,7 b' try:'
147 pickle.dump # import now
147 pickle.dump # import now
148 except ImportError:
148 except ImportError:
149 import pickle
149 import pickle
150 import errno
150 import os
151 import os
151 import sys
152 import sys
152
153
@@ -741,7 +742,12 b' def writestate(repo, parentnode, rules, '
741 def readstate(repo):
742 def readstate(repo):
742 """Returns a tuple of (parentnode, rules, keep, topmost, replacements).
743 """Returns a tuple of (parentnode, rules, keep, topmost, replacements).
743 """
744 """
744 fp = open(os.path.join(repo.path, 'histedit-state'))
745 try:
746 fp = open(os.path.join(repo.path, 'histedit-state'))
747 except IOError, err:
748 if err.errno != errno.ENOENT:
749 raise
750 raise util.Abort(_('no histedit in progress'))
745 return pickle.load(fp)
751 return pickle.load(fp)
746
752
747
753
@@ -41,6 +41,16 b' Repo setup.'
41 one
41 one
42
42
43
43
44 histedit --continue/--abort with no existing state
45 --------------------------------------------------
46
47 $ hg histedit --continue
48 abort: no histedit in progress
49 [255]
50 $ hg histedit --abort
51 abort: no histedit in progress
52 [255]
53
44 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
54 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
45 --------------------------------------------------------------------
55 --------------------------------------------------------------------
46
56
General Comments 0
You need to be logged in to leave comments. Login now