# HG changeset patch # User Durham Goode # Date 1429289203 25200 # Node ID f5416657e661b3d2d811efb64ea5cf1648080cc9 # Parent 32d0d2f38910d4397b2a05c148e3fb0255588539 histedit: change state format to allow non-hash lines The existing state serialization format assumed the rule line consisted of an action and a hash. In our external extension that adds 'exec' this is not the case (there is no hash, just the shell command). So let's change the format to be more generic with just an action and a remainder, and the various commands can handle it as they wish. Flagged for stable since we want to get this format tweak in before the new format goes live in the release. diff -r 32d0d2f38910 -r f5416657e661 hgext/histedit.py --- a/hgext/histedit.py Fri Apr 17 15:42:20 2015 -0500 +++ b/hgext/histedit.py Fri Apr 17 09:46:43 2015 -0700 @@ -246,7 +246,8 @@ fp.write('%s\n' % self.keep) fp.write('%d\n' % len(self.rules)) for rule in self.rules: - fp.write('%s%s\n' % (rule[1], rule[0])) + fp.write('%s\n' % rule[0]) # action + fp.write('%s\n' % rule[1]) # remainder fp.write('%d\n' % len(self.replacements)) for replacement in self.replacements: fp.write('%s%s\n' % (node.hex(replacement[0]), ''.join(node.hex(r) @@ -276,11 +277,11 @@ rulelen = int(lines[index]) index += 1 for i in xrange(rulelen): + ruleaction = lines[index] + index += 1 rule = lines[index] - rulehash = rule[:40] - ruleaction = rule[40:] - rules.append((ruleaction, rulehash)) index += 1 + rules.append((ruleaction, rule)) # Replacements replacements = []