Show More
@@ -1538,28 +1538,33 b' class revlog(object):' | |||
|
1538 | 1538 | def _partialmatch(self, id): |
|
1539 | 1539 | # we don't care wdirfilenodeids as they should be always full hash |
|
1540 | 1540 | maybewdir = self.nodeconstants.wdirhex.startswith(id) |
|
1541 | ambiguous = False | |
|
1541 | 1542 | try: |
|
1542 | 1543 | partial = self.index.partialmatch(id) |
|
1543 | 1544 | if partial and self.hasnode(partial): |
|
1544 | 1545 | if maybewdir: |
|
1545 | 1546 | # single 'ff...' match in radix tree, ambiguous with wdir |
|
1546 | raise error.RevlogError | |
|
1547 |
|
|
|
1548 | if maybewdir: | |
|
1547 | ambiguous = True | |
|
1548 | else: | |
|
1549 | return partial | |
|
1550 | elif maybewdir: | |
|
1549 | 1551 | # no 'ff...' match in radix tree, wdir identified |
|
1550 | 1552 | raise error.WdirUnsupported |
|
1551 |
|
|
|
1553 | else: | |
|
1554 | return None | |
|
1552 | 1555 | except error.RevlogError: |
|
1553 | 1556 | # parsers.c radix tree lookup gave multiple matches |
|
1554 | 1557 | # fast path: for unfiltered changelog, radix tree is accurate |
|
1555 | 1558 | if not getattr(self, 'filteredrevs', None): |
|
1556 |
|
|
|
1557 | id, self.display_id, _(b'ambiguous identifier') | |
|
1558 | ) | |
|
1559 | ambiguous = True | |
|
1559 | 1560 | # fall through to slow path that filters hidden revisions |
|
1560 | 1561 | except (AttributeError, ValueError): |
|
1561 | 1562 | # we are pure python, or key was too short to search radix tree |
|
1562 | 1563 | pass |
|
1564 | if ambiguous: | |
|
1565 | raise error.AmbiguousPrefixLookupError( | |
|
1566 | id, self.display_id, _(b'ambiguous identifier') | |
|
1567 | ) | |
|
1563 | 1568 | |
|
1564 | 1569 | if id in self._pcache: |
|
1565 | 1570 | return self._pcache[id] |
General Comments 0
You need to be logged in to leave comments.
Login now