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

login
register
mail settings
Submitter phabricator
Date Jan. 16, 2019, 5:21 p.m.
Message ID <a5db92ca572b84a7ff35b19cf49a9b03@localhost.localdomain>
Download mbox | patch
Permalink /patch/37824/
State Not Applicable
Headers show

Comments

phabricator - Jan. 16, 2019, 5:21 p.m.
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




To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

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: