##// END OF EJS Templates
histedit: only use pickle if not using the modern save format...
Bryan O'Sullivan -
r27527:dbfaf361 default
parent child Browse files
Show More
@@ -252,19 +252,19 b' class histeditstate(object):'
252 def read(self):
252 def read(self):
253 """Load histedit state from disk and set fields appropriately."""
253 """Load histedit state from disk and set fields appropriately."""
254 try:
254 try:
255 fp = self.repo.vfs('histedit-state', 'r')
255 state = self.repo.vfs.read('histedit-state')
256 except IOError as err:
256 except IOError as err:
257 if err.errno != errno.ENOENT:
257 if err.errno != errno.ENOENT:
258 raise
258 raise
259 raise error.Abort(_('no histedit in progress'))
259 raise error.Abort(_('no histedit in progress'))
260
260
261 try:
261 if state.startswith('v1\n'):
262 data = pickle.load(fp)
262 data = self._load()
263 parentctxnode, rules, keep, topmost, replacements, backupfile = data
264 else:
265 data = pickle.loads(state)
263 parentctxnode, rules, keep, topmost, replacements = data
266 parentctxnode, rules, keep, topmost, replacements = data
264 backupfile = None
267 backupfile = None
265 except pickle.UnpicklingError:
266 data = self._load()
267 parentctxnode, rules, keep, topmost, replacements, backupfile = data
268
268
269 self.parentctxnode = parentctxnode
269 self.parentctxnode = parentctxnode
270 rules = "\n".join(["%s %s" % (verb, rest) for [verb, rest] in rules])
270 rules = "\n".join(["%s %s" % (verb, rest) for [verb, rest] in rules])
General Comments 0
You need to be logged in to leave comments. Login now