# HG changeset patch # User Augie Fackler # Date 2019-01-16 16:01:16 # Node ID ebda5d4265ec759df04c1b95ce3bc128063d6c8b # Parent 60b3edccf2f72240ec75da41a2692e2c8da9e7f9 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 diff --git a/hgext/remotefilelog/shallowbundle.py b/hgext/remotefilelog/shallowbundle.py --- a/hgext/remotefilelog/shallowbundle.py +++ b/hgext/remotefilelog/shallowbundle.py @@ -269,8 +269,8 @@ def addchangegroupfiles(orig, repo, sour 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: