D5606: remotefilelog: check against bytes type instead of buffer and coerce to bytes
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Wed Jan 16 16:16:42 UTC 2019
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Fixes Python 3 compat here.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5606
AFFECTED FILES
hgext/remotefilelog/shallowbundle.py
CHANGE DETAILS
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 @@
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:
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list