diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -27,10 +27,12 @@ def _string_escape(text): def decodeextra(text): """ - >>> decodeextra(encodeextra({'foo': 'bar', 'baz': chr(0) + '2'})) - {'foo': 'bar', 'baz': '\\x002', 'branch': 'default'} - >>> decodeextra(encodeextra({'foo': 'bar', 'baz': chr(92) + chr(0) + '2'})) - {'foo': 'bar', 'baz': '\\\\\\x002', 'branch': 'default'} + >>> from pprint import pprint as pp + >>> pp(decodeextra(encodeextra({'foo': 'bar', 'baz': chr(0) + '2'}))) + {'baz': '\\x002', 'branch': 'default', 'foo': 'bar'} + >>> pp(decodeextra(encodeextra({'foo': 'bar', + ... 'baz': chr(92) + chr(0) + '2'}))) + {'baz': '\\\\\\x002', 'branch': 'default', 'foo': 'bar'} """ extra = _defaultextra.copy() for l in text.split('\0'): diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -80,8 +80,8 @@ def tolocal(s): 'foo: \\xc3\\xa4' >>> u2 = 'foo: \\xc3\\xa1' >>> d = { l: 1, tolocal(u2): 2 } - >>> d # no collision - {'foo: ?': 1, 'foo: ?': 2} + >>> len(d) # no collision + 2 >>> 'foo: ?' in d False >>> l1 = 'foo: \\xe4' # historical latin1 fallback