changeset 4847:845e0071b704

Sort changelog extra dict to avoid possible nondeterminism
author Brendan Cully <brendan@kublai.com>
date Fri, 06 Jul 2007 10:22:22 -0700
parents 40007fe82be9
children 5e365008360f
files mercurial/changelog.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):