martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers.
REVISION SUMMARY I don't know what happened here because b436059c1cca <https://phab.mercurial-scm.org/rHGb436059c1cca85ec327889a8fba17837e5c7b8e6> (py3: use pycompat.bytestr() on extra values because it can be int, 2019-02-05) came about b44a47214122 <https://phab.mercurial-scm.org/rHGb44a4721412228aec4fde226bef594f4691ea61f> (py3: use string for "close" value in commit extras, 2018-02-11). Whatever happened, we shouldn't need to convert the values to bytes now. It's better to not convert because that might cover up bugs where someone sets a unicode value in the extras and that works until the unicode value happens to contain non-ascii (at which point it will fail because `bytestr()` expects its argument to be ascii if it's unicode). REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D8332 AFFECTED FILES mercurial/changelog.py CHANGE DETAILS diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -82,10 +82,7 @@ def encodeextra(d): # keys must be sorted to produce a deterministic changelog entry - items = [ - _string_escape(b'%s:%s' % (k, pycompat.bytestr(d[k]))) - for k in sorted(d) - ] + items = [_string_escape(b'%s:%s' % (k, d[k])) for k in sorted(d)] return b"\0".join(items) To: martinvonz, #hg-reviewers Cc: mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel