D4735: revlog: catch more specific exception in shortest()

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Tue Sep 25 13:33:09 UTC 2018


yuja created this revision.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Since revlog._partialmatch() catches RevlogError coming from cext and
  re-raises AmbiguousPrefixLookupError, catching RevlogError here seems
  less correct.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4735

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1325,7 +1325,7 @@
         def isvalid(prefix):
             try:
                 node = self._partialmatch(prefix)
-            except error.RevlogError:
+            except error.AmbiguousPrefixLookupError:
                 return False
             except error.WdirUnsupported:
                 # single 'ff...' match



To: yuja, indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list