comparison mercurial/revlog.py @ 47159:1ec64f59dc27

revlog: use revlog.display_id in ambiguity errors Differential Revision: https://phab.mercurial-scm.org/D10585
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:24:08 +0200
parents e1936ae27897
children 0a66eef0ed97
comparison
equal deleted inserted replaced
47158:e1936ae27897 47159:1ec64f59dc27
1398 except error.RevlogError: 1398 except error.RevlogError:
1399 # parsers.c radix tree lookup gave multiple matches 1399 # parsers.c radix tree lookup gave multiple matches
1400 # fast path: for unfiltered changelog, radix tree is accurate 1400 # fast path: for unfiltered changelog, radix tree is accurate
1401 if not getattr(self, 'filteredrevs', None): 1401 if not getattr(self, 'filteredrevs', None):
1402 raise error.AmbiguousPrefixLookupError( 1402 raise error.AmbiguousPrefixLookupError(
1403 id, self._indexfile, _(b'ambiguous identifier') 1403 id, self.display_id, _(b'ambiguous identifier')
1404 ) 1404 )
1405 # fall through to slow path that filters hidden revisions 1405 # fall through to slow path that filters hidden revisions
1406 except (AttributeError, ValueError): 1406 except (AttributeError, ValueError):
1407 # we are pure python, or key was too short to search radix tree 1407 # we are pure python, or key was too short to search radix tree
1408 pass 1408 pass
1424 if len(nl) > 0: 1424 if len(nl) > 0:
1425 if len(nl) == 1 and not maybewdir: 1425 if len(nl) == 1 and not maybewdir:
1426 self._pcache[id] = nl[0] 1426 self._pcache[id] = nl[0]
1427 return nl[0] 1427 return nl[0]
1428 raise error.AmbiguousPrefixLookupError( 1428 raise error.AmbiguousPrefixLookupError(
1429 id, self._indexfile, _(b'ambiguous identifier') 1429 id, self.display_id, _(b'ambiguous identifier')
1430 ) 1430 )
1431 if maybewdir: 1431 if maybewdir:
1432 raise error.WdirUnsupported 1432 raise error.WdirUnsupported
1433 return None 1433 return None
1434 except TypeError: 1434 except TypeError: