# HG changeset patch # User Mads Kiilerich # Date 2018-05-11 14:26:48 # Node ID 61fd14c13e608fa3a14a201ade54404520a5c53d # Parent 03dfcbe52906693498320b6e00b34d62bd15611c hg: use localrepo indexing for revision number lookup instead of the lookup function Mercurial 4.6 (0a1fb171dc1d) changed lookup and would fail if given a revision number. diff --git a/kallithea/lib/vcs/backends/hg/repository.py b/kallithea/lib/vcs/backends/hg/repository.py --- a/kallithea/lib/vcs/backends/hg/repository.py +++ b/kallithea/lib/vcs/backends/hg/repository.py @@ -411,7 +411,7 @@ class MercurialRepository(BaseRepository def _get_revision(self, revision): """ - Gets an ID revision given as str. This will always return a fill + Gets an ID revision given as str. This will always return a full 40 char revision number :param revision: str or int or None @@ -426,7 +426,7 @@ class MercurialRepository(BaseRepository revision = 'tip' try: - revision = hex(self._repo.lookup(revision)) + revision = self._repo[revision].hex() except (IndexError, ValueError, RepoLookupError, TypeError): msg = ("Revision %s does not exist for %s" % (revision, self)) raise ChangesetDoesNotExistError(msg)