Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 39831:7a9e2d85f475
revlog: catch more specific exception in shortest()
Since revlog._partialmatch() catches RevlogError coming from cext and
re-raises AmbiguousPrefixLookupError, catching RevlogError here seems
less correct.
Differential Revision: https://phab.mercurial-scm.org/D4735
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 25 Sep 2018 22:19:40 +0900 |
parents | a6b3c4c1019f |
children | 97986c9c69d3 |
comparison
equal
deleted
inserted
replaced
39830:e5871e8fbb57 | 39831:7a9e2d85f475 |
---|---|
1323 def shortest(self, node, minlength=1): | 1323 def shortest(self, node, minlength=1): |
1324 """Find the shortest unambiguous prefix that matches node.""" | 1324 """Find the shortest unambiguous prefix that matches node.""" |
1325 def isvalid(prefix): | 1325 def isvalid(prefix): |
1326 try: | 1326 try: |
1327 node = self._partialmatch(prefix) | 1327 node = self._partialmatch(prefix) |
1328 except error.RevlogError: | 1328 except error.AmbiguousPrefixLookupError: |
1329 return False | 1329 return False |
1330 except error.WdirUnsupported: | 1330 except error.WdirUnsupported: |
1331 # single 'ff...' match | 1331 # single 'ff...' match |
1332 return True | 1332 return True |
1333 if node is None: | 1333 if node is None: |