##// END OF EJS Templates
mercurial: compatability changes for mercurial 4.6.0 release
marcink -
r2735:a8937381 default
parent child Browse files
Show More
@@ -56,7 +56,7 b' class MercurialCommit(base.BaseCommit):'
56 self._remote = repository._remote
56 self._remote = repository._remote
57
57
58 self.raw_id = raw_id
58 self.raw_id = raw_id
59 self.idx = repository._sanitize_commit_idx(idx)
59 self.idx = idx
60
60
61 self._set_bulk_properties(pre_load)
61 self._set_bulk_properties(pre_load)
62
62
@@ -395,14 +395,6 b' class MercurialRepository(BaseRepository'
395 else:
395 else:
396 return os.stat(st_path).st_mtime
396 return os.stat(st_path).st_mtime
397
397
398 def _sanitize_commit_idx(self, idx):
399 # Note: Mercurial has ``int(-1)`` reserved as not existing id_or_idx
400 # number. A `long` is treated in the correct way though. So we convert
401 # `int` to `long` here to make sure it is handled correctly.
402 if isinstance(idx, int):
403 return long(idx)
404 return idx
405
406 def _get_url(self, url):
398 def _get_url(self, url):
407 """
399 """
408 Returns normalized url. If schema is not given, would fall
400 Returns normalized url. If schema is not given, would fall
@@ -437,7 +429,6 b' class MercurialRepository(BaseRepository'
437 pass
429 pass
438 elif commit_idx is not None:
430 elif commit_idx is not None:
439 self._validate_commit_idx(commit_idx)
431 self._validate_commit_idx(commit_idx)
440 commit_idx = self._sanitize_commit_idx(commit_idx)
441 try:
432 try:
442 id_ = self.commit_ids[commit_idx]
433 id_ = self.commit_ids[commit_idx]
443 if commit_idx < 0:
434 if commit_idx < 0:
@@ -449,10 +440,6 b' class MercurialRepository(BaseRepository'
449 else:
440 else:
450 commit_id = "tip"
441 commit_id = "tip"
451
442
452 # TODO Paris: Ugly hack to "serialize" long for msgpack
453 if isinstance(commit_id, long):
454 commit_id = float(commit_id)
455
456 if isinstance(commit_id, unicode):
443 if isinstance(commit_id, unicode):
457 commit_id = safe_str(commit_id)
444 commit_id = safe_str(commit_id)
458
445
General Comments 0
You need to be logged in to leave comments. Login now