changeset 41256:ebda5d4265ec

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
author Augie Fackler <augie@google.com>
date Wed, 16 Jan 2019 11:01:16 -0500
parents 60b3edccf2f7
children d08c816a11d3
files hgext/remotefilelog/shallowbundle.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: