Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 38880:df0873ab5c14
revlog: use specialized exception for ambiguous prefix lookup
It's useful to be able to catch a specific exception for this
case. We'll use it soon.
Differential Revision: https://phab.mercurial-scm.org/D4036
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 13 Apr 2018 23:37:53 -0700 |
parents | a232e6744ba3 |
children | ad24b581e4d9 |
comparison
equal
deleted
inserted
replaced
38879:794afa91f0a5 | 38880:df0873ab5c14 |
---|---|
858 return context.workingctx(self) | 858 return context.workingctx(self) |
859 | 859 |
860 def __contains__(self, changeid): | 860 def __contains__(self, changeid): |
861 """True if the given changeid exists | 861 """True if the given changeid exists |
862 | 862 |
863 error.LookupError is raised if an ambiguous node specified. | 863 error.AmbiguousPrefixLookupError is raised if an ambiguous node |
864 specified. | |
864 """ | 865 """ |
865 try: | 866 try: |
866 self[changeid] | 867 self[changeid] |
867 return True | 868 return True |
868 except error.RepoLookupError: | 869 except error.RepoLookupError: |