manifest: use node.hex instead of .encode('hex')
authorAugie Fackler <augie@google.com>
Sun, 19 Mar 2017 01:11:37 -0400
changeset 31530 160e7ad941e9
parent 31529 61ff3852f6ed
child 31531 326bca5477d0
manifest: use node.hex instead of .encode('hex') The latter doesn't work on Python 3.
mercurial/manifest.py
--- a/mercurial/manifest.py	Mon Mar 20 21:40:28 2017 -0700
+++ b/mercurial/manifest.py	Sun Mar 19 01:11:37 2017 -0400
@@ -12,7 +12,10 @@
 import struct
 
 from .i18n import _
-from .node import bin
+from .node import (
+    bin,
+    hex,
+)
 from . import (
     error,
     mdiff,
@@ -355,7 +358,7 @@
         self.extradata = []
 
     def _pack(self, d):
-        return d[0] + '\x00' + d[1][:20].encode('hex') + d[2] + '\n'
+        return d[0] + '\x00' + hex(d[1][:20]) + d[2] + '\n'
 
     def text(self):
         self._compact()