remotefilelog: check against bytes type instead of buffer and coerce to bytes
authorAugie Fackler <augie@google.com>
Wed, 16 Jan 2019 11:01:16 -0500
changeset 41256 ebda5d4265ec
parent 41255 60b3edccf2f7
child 41257 d08c816a11d3
remotefilelog: check against bytes type instead of buffer and coerce to bytes Fixes Python 3 compat here. Differential Revision: https://phab.mercurial-scm.org/D5606
hgext/remotefilelog/shallowbundle.py
--- a/hgext/remotefilelog/shallowbundle.py	Wed Jan 16 11:00:10 2019 -0500
+++ b/hgext/remotefilelog/shallowbundle.py	Wed Jan 16 11:01:16 2019 -0500
@@ -269,8 +269,8 @@
 
         base = fl.revision(deltabase, raw=True)
         text = mdiff.patch(base, delta)
-        if isinstance(text, buffer):
-            text = str(text)
+        if not isinstance(text, bytes):
+            text = bytes(text)
 
         meta, text = shallowutil.parsemeta(text)
         if 'copy' in meta: