Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 37385:ecd3f6909184
context: move handling of filtering error to revsymbol() (API)
When changectx's constructor runs into various Filtered*Error, it
creates an exception with a hint about using --hidden. This only makes
sense when the revision was provided by the user (if we get e.g. a
FilteredLookupError from repo[p1], then it's instead a programming
error). Thus, I'm moving the handling into revsymbol(). Also changed
"unfilteredrepo[changeid]" to "revsymbol(unfilteredrepo, changeid)" as
part of the move.
Differential Revision: https://phab.mercurial-scm.org/D3143
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 05 Apr 2018 00:04:09 -0700 |
parents | 92171562c7f3 |
children | f3dc8239e3a9 |
comparison
equal
deleted
inserted
replaced
37384:5c9d0af7b02e | 37385:ecd3f6909184 |
---|---|
800 error.LookupError is raised if an ambiguous node specified. | 800 error.LookupError is raised if an ambiguous node specified. |
801 """ | 801 """ |
802 try: | 802 try: |
803 self[changeid] | 803 self[changeid] |
804 return True | 804 return True |
805 except error.RepoLookupError: | 805 except (error.RepoLookupError, error.FilteredIndexError, |
806 error.FilteredLookupError): | |
806 return False | 807 return False |
807 | 808 |
808 def __nonzero__(self): | 809 def __nonzero__(self): |
809 return True | 810 return True |
810 | 811 |