Patchwork D6661: lookup: don't use "00changelog.i@None" when lookup of prefix fails

login
register
mail settings
Submitter phabricator
Date July 19, 2019, 5:37 p.m.
Message ID <differential-rev-PHID-DREV-623tl77kkamjss4mqapp-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/40981/
State Superseded
Headers show

Comments

phabricator - July 19, 2019, 5:37 p.m.
martinvonz created this revision.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We were shadowing the "node" variable, so we always passed None to the
  LookupError instead of the node we meant to pass.
  
  (This showed up in py3 tests since py3 doesn't like to format None
  using "%s".)

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: martinvonz, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1355,13 +1355,13 @@ 
         """Find the shortest unambiguous prefix that matches node."""
         def isvalid(prefix):
             try:
-                node = self._partialmatch(prefix)
+                matchednode = self._partialmatch(prefix)
             except error.AmbiguousPrefixLookupError:
                 return False
             except error.WdirUnsupported:
                 # single 'ff...' match
                 return True
-            if node is None:
+            if matchednode is None:
                 raise error.LookupError(node, self.indexfile, _('no node'))
             return True