comparison mercurial/scmutil.py @ 38841: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 2002c193f2bc
children 503f936489dd
comparison
equal deleted inserted replaced
38840:794afa91f0a5 38841:df0873ab5c14
478 raise error.RepoLookupError() 478 raise error.RepoLookupError()
479 479
480 def isrevsymbol(repo, symbol): 480 def isrevsymbol(repo, symbol):
481 """Checks if a symbol exists in the repo. 481 """Checks if a symbol exists in the repo.
482 482
483 See revsymbol() for details. Raises error.LookupError if the symbol is an 483 See revsymbol() for details. Raises error.AmbiguousPrefixLookupError if the
484 ambiguous nodeid prefix. 484 symbol is an ambiguous nodeid prefix.
485 """ 485 """
486 try: 486 try:
487 revsymbol(repo, symbol) 487 revsymbol(repo, symbol)
488 return True 488 return True
489 except error.RepoLookupError: 489 except error.RepoLookupError: