# HG changeset patch # User Marcin Kuzminski # Date 2020-02-14 13:20:37 # Node ID e85e735f56bfa52ca13a94be927ea8b2dbfe84ac # Parent c136d01d95b4d2403ac2a69a805bf7743dc870bf mercurial: fixed lookup case of pure numeric refs. diff --git a/vcsserver/hgcompat.py b/vcsserver/hgcompat.py --- a/vcsserver/hgcompat.py +++ b/vcsserver/hgcompat.py @@ -67,9 +67,13 @@ from mercurial.url import httpbasicauthh def get_ctx(repo, ref): try: ctx = repo[ref] - except (ProgrammingError, LookupError, RepoLookupError): + except ProgrammingError: # we're unable to find the rev using a regular lookup, we fallback # to slower, but backward compat revsymbol usage ctx = revsymbol(repo, ref) - + except (LookupError, RepoLookupError): + # Similar case as above but only for refs that are not numeric + if isinstance(ref, (int, long)): + raise + ctx = revsymbol(repo, ref) return ctx