Mercurial > hg
diff hgext/remotefilelog/shallowbundle.py @ 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 | 4e08bbfc6d51 |
children | 0531dff73d0b |
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: