py3: use pycompat.bytestr() on extra values because it can be int
authorPulkit Goyal <pulkit@yandex-team.ru>
Tue, 05 Feb 2019 21:31:33 +0300
changeset 41574 b436059c1cca
parent 41573 83d62df28ab6
child 41575 aec185af621e
py3: use pycompat.bytestr() on extra values because it can be int One such example is {'close': 1} which marks a branch as closed. This makes test-convert-mtn.t pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5864
contrib/python3-whitelist
mercurial/changelog.py
--- a/contrib/python3-whitelist	Tue Feb 05 21:30:30 2019 +0300
+++ b/contrib/python3-whitelist	Tue Feb 05 21:31:33 2019 +0300
@@ -121,6 +121,7 @@
 test-convert-hg-sink.t
 test-convert-hg-source.t
 test-convert-hg-startrev.t
+test-convert-mtn.t
 test-convert-splicemap.t
 test-convert-svn-sink.t
 test-convert-tagsbranch-topology.t
--- a/mercurial/changelog.py	Tue Feb 05 21:30:30 2019 +0300
+++ b/mercurial/changelog.py	Tue Feb 05 21:31:33 2019 +0300
@@ -70,7 +70,10 @@
 
 def encodeextra(d):
     # keys must be sorted to produce a deterministic changelog entry
-    items = [_string_escape('%s:%s' % (k, d[k])) for k in sorted(d)]
+    items = [
+        _string_escape('%s:%s' % (k, pycompat.bytestr(d[k])))
+        for k in sorted(d)
+    ]
     return "\0".join(items)
 
 def stripdesc(desc):