Patchwork D7533: repair: fix an `isinstance(nodelist, str)` check for py3

login
register
mail settings
Submitter phabricator
Date Nov. 30, 2019, 5:09 p.m.
Message ID <differential-rev-PHID-DREV-2x56icnmyj2t6tt72wsb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43544/
State Superseded
Headers show

Comments

phabricator - Nov. 30, 2019, 5:09 p.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  All of the callers appear to pass a list, so this doesn't fix anything in core
  hg.  But maybe out of tree extensions use this shortcut.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 1, 2019, 9:49 a.m.
dlax added a comment.
dlax accepted this revision.


  All these API where one can pass either a list of "things" or just one "thing" is kind of ugly. We should only handle the list case, I think.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7533/new/

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

To: mharbison72, #hg-reviewers, dlax
Cc: dlax, mercurial-devel

Patch

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -130,7 +130,7 @@ 
     cl = repo.changelog
 
     # TODO handle undo of merge sets
-    if isinstance(nodelist, str):
+    if isinstance(nodelist, bytes):
         nodelist = [nodelist]
     striplist = [cl.rev(node) for node in nodelist]
     striprev = min(striplist)