# HG changeset patch # User Marcin Kuzminski # Date 2018-05-09 19:40:20 # Node ID a8937381e72aec8c63060aba59a87b666545d683 # Parent caa42fff95f009ef588190df014aee34f5c8380b mercurial: compatability changes for mercurial 4.6.0 release diff --git a/rhodecode/lib/vcs/backends/hg/commit.py b/rhodecode/lib/vcs/backends/hg/commit.py --- a/rhodecode/lib/vcs/backends/hg/commit.py +++ b/rhodecode/lib/vcs/backends/hg/commit.py @@ -56,7 +56,7 @@ class MercurialCommit(base.BaseCommit): self._remote = repository._remote self.raw_id = raw_id - self.idx = repository._sanitize_commit_idx(idx) + self.idx = idx self._set_bulk_properties(pre_load) diff --git a/rhodecode/lib/vcs/backends/hg/repository.py b/rhodecode/lib/vcs/backends/hg/repository.py --- a/rhodecode/lib/vcs/backends/hg/repository.py +++ b/rhodecode/lib/vcs/backends/hg/repository.py @@ -395,14 +395,6 @@ class MercurialRepository(BaseRepository else: return os.stat(st_path).st_mtime - def _sanitize_commit_idx(self, idx): - # Note: Mercurial has ``int(-1)`` reserved as not existing id_or_idx - # number. A `long` is treated in the correct way though. So we convert - # `int` to `long` here to make sure it is handled correctly. - if isinstance(idx, int): - return long(idx) - return idx - def _get_url(self, url): """ Returns normalized url. If schema is not given, would fall @@ -437,7 +429,6 @@ class MercurialRepository(BaseRepository pass elif commit_idx is not None: self._validate_commit_idx(commit_idx) - commit_idx = self._sanitize_commit_idx(commit_idx) try: id_ = self.commit_ids[commit_idx] if commit_idx < 0: @@ -449,10 +440,6 @@ class MercurialRepository(BaseRepository else: commit_id = "tip" - # TODO Paris: Ugly hack to "serialize" long for msgpack - if isinstance(commit_id, long): - commit_id = float(commit_id) - if isinstance(commit_id, unicode): commit_id = safe_str(commit_id)