Patchwork D5611: fastannotate: fix isinstance checks to be against bytes instead of str

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

Comments

phabricator - Jan. 16, 2019, 5:22 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1198c86beb73: fastannotate: fix isinstance checks to be against bytes instead of str (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5611?vs=13272&id=13291

REVISION DETAIL
  https://phab.mercurial-scm.org/D5611

AFFECTED FILES
  hgext/fastannotate/context.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/fastannotate/context.py b/hgext/fastannotate/context.py
--- a/hgext/fastannotate/context.py
+++ b/hgext/fastannotate/context.py
@@ -602,7 +602,7 @@ 
         the best case, the user provides a node and we don't need to read the
         filelog or construct any filecontext.
         """
-        if isinstance(f, str):
+        if isinstance(f, bytes):
             hsh = f
         else:
             hsh = f.node()
@@ -625,7 +625,7 @@ 
         if showpath:
             result = self._addpathtoresult(result)
         if showlines:
-            if isinstance(f, str): # f: node or fctx
+            if isinstance(f, bytes): # f: node or fctx
                 llrev = self.revmap.hsh2rev(f)
                 fctx = self._resolvefctx(f, self.revmap.rev2path(llrev))
             else: