# HG changeset patch # User Mads Kiilerich # Date 2014-07-18 17:01:37 # Node ID 22da5c75e660ccb4ebbd4773ed1fd25fc67d4e02 # Parent dfdf6b1d38e9437ea7aeed0c5e8039395a6a5027 vcs: convert unicode revision strings to ascii before passing to Mercurial 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 @@ -25,7 +25,7 @@ from kallithea.lib.vcs.exceptions import RepositoryError, VCSError, TagAlreadyExistError, TagDoesNotExistError ) from kallithea.lib.vcs.utils import ( - author_email, author_name, date_fromtimestamp, makedate, safe_unicode + author_email, author_name, date_fromtimestamp, makedate, safe_unicode, safe_str, ) from kallithea.lib.vcs.utils.lazy import LazyProperty from kallithea.lib.vcs.utils.ordered_dict import OrderedDict @@ -429,6 +429,8 @@ class MercurialRepository(BaseRepository :param revision: str or int or None """ + if isinstance(revision, unicode): + revision = safe_str(revision) if self._empty: raise EmptyRepositoryError("There are no changesets yet")