Mercurial > kallithea
changeset 7272:61fd14c13e60
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.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Fri, 11 May 2018 14:26:48 +0200 |
parents | 03dfcbe52906 |
children | 52983fa97f49 |
files | kallithea/lib/vcs/backends/hg/repository.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/vcs/backends/hg/repository.py Fri May 11 14:26:48 2018 +0200 +++ b/kallithea/lib/vcs/backends/hg/repository.py Fri May 11 14:26:48 2018 +0200 @@ -411,7 +411,7 @@ 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 @@ 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)