lookup: don't use "00changelog.i@None" when lookup of prefix fails
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 19 Jul 2019 09:43:50 -0700
changeset 42629 24111fb9a725
parent 42628 eb27d9eee2cc
child 42630 a2c02877b097
lookup: don't use "00changelog.i@None" when lookup of prefix fails 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".) Differential Revision: https://phab.mercurial-scm.org/D6661
mercurial/revlog.py
--- a/mercurial/revlog.py	Thu Jul 18 14:23:21 2019 -0400
+++ b/mercurial/revlog.py	Fri Jul 19 09:43:50 2019 -0700
@@ -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