changeset 24958:a920abf5a592 stable

histedit: fix serializing of None backupfile If the histedit backupfile was None (like if evolve is enabled) it would get serialized as 'None' into the state file. Later if the histedit was aborted and the top most commit was unreachable (ex: if it was obsolete or stripped), histedit would try to unbundle the backupfile and try to read .hg/None. This fixes it to not serialize None. Since it only happens with evolve, I'm not sure how to add test coverage here.
author Durham Goode <durham@fb.com>
date Fri, 01 May 2015 15:28:47 -0700
parents 169d2470d283
children 3c762cceedde
files hgext/histedit.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Thu May 07 07:46:39 2015 +0900
+++ b/hgext/histedit.py	Fri May 01 15:28:47 2015 -0700
@@ -252,7 +252,10 @@
         for replacement in self.replacements:
             fp.write('%s%s\n' % (node.hex(replacement[0]), ''.join(node.hex(r)
                 for r in replacement[1])))
-        fp.write('%s\n' % self.backupfile)
+        backupfile = self.backupfile
+        if not backupfile:
+            backupfile = ''
+        fp.write('%s\n' % backupfile)
         fp.close()
 
     def _load(self):