Mercurial > hg
changeset 42629:24111fb9a725
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 19 Jul 2019 09:43:50 -0700 |
parents | eb27d9eee2cc |
children | a2c02877b097 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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