mercurial: compatability changes for mercurial 4.6.0 release

This commit is contained in:
Marcin Kuzminski 2018-05-09 21:40:20 +02:00
parent b59e2e9485
commit 382b0cf748
2 changed files with 1 additions and 14 deletions

View file

@ -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)

View file

@ -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)