# HG changeset patch # User Durham Goode # Date 2015-05-01 22:28:47 # Node ID a920abf5a592038e15b6e292974938a2bf3d0d48 # Parent 169d2470d283f19f7c94112dc1eff1d355f29f40 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. diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -252,7 +252,10 @@ class histeditstate(object): 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):