Sort changelog extra dict to avoid possible nondeterminism
authorBrendan Cully <brendan@kublai.com>
Fri, 06 Jul 2007 10:22:22 -0700
changeset 4847 845e0071b704
parent 4846 40007fe82be9
child 4848 5e365008360f
Sort changelog extra dict to avoid possible nondeterminism
mercurial/changelog.py
--- a/mercurial/changelog.py	Fri Jul 06 10:11:48 2007 -0700
+++ b/mercurial/changelog.py	Fri Jul 06 10:22:22 2007 -0700
@@ -131,7 +131,8 @@
         return extra
 
     def encode_extra(self, d):
-        items = [_string_escape(":".join(t)) for t in d.iteritems()]
+        # keys must be sorted to produce a deterministic changelog entry
+        items = [_string_escape('%s:%s' % (k, d[k])) for k in sorted(d)]
         return "\0".join(items)
 
     def extract(self, text):