D5606: remotefilelog: check against bytes type instead of buffer and coerce to bytes

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jan 16 12:21:46 EST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGebda5d4265ec: remotefilelog: check against bytes type instead of buffer and coerce to bytes (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5606?vs=13266&id=13286

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, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list