Mercurial > public > mercurial-scm > hg
comparison mercurial/changelog.py @ 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 | 63b9d2deed48 |
children | 5e365008360f |
comparison
equal
deleted
inserted
replaced
4846:40007fe82be9 | 4847:845e0071b704 |
---|---|
129 k, v = _string_unescape(l).split(':', 1) | 129 k, v = _string_unescape(l).split(':', 1) |
130 extra[k] = v | 130 extra[k] = v |
131 return extra | 131 return extra |
132 | 132 |
133 def encode_extra(self, d): | 133 def encode_extra(self, d): |
134 items = [_string_escape(":".join(t)) for t in d.iteritems()] | 134 # keys must be sorted to produce a deterministic changelog entry |
135 items = [_string_escape('%s:%s' % (k, d[k])) for k in sorted(d)] | |
135 return "\0".join(items) | 136 return "\0".join(items) |
136 | 137 |
137 def extract(self, text): | 138 def extract(self, text): |
138 """ | 139 """ |
139 format used: | 140 format used: |