Skip to content

Commit

Permalink
Merge pull request airspeed-velocity#643 from philpep/hg-fixes
Browse files Browse the repository at this point in the history
Fix support for mercurial >= 4.5
  • Loading branch information
pv authored May 24, 2018
2 parents 92c072a + 1821da4 commit 285f9ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions asv/plugins/mercurial.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ def get_date(self, hash):
rev = self._repo.log(self._encode(hash))[0]
return int(rev.date.strftime("%s")) * 1000

def get_hashes_from_range(self, range_spec):
def get_hashes_from_range(self, range_spec, **kwargs):
range_spec = self._encode("sort({0}, -rev)".format(range_spec))
return [self._decode(rev.node) for rev in self._repo.log(range_spec,
followfirst=True)]
return [self._decode(rev.node) for rev in self._repo.log(range_spec, **kwargs)]

def get_hash_from_name(self, name):
if name is None:
Expand All @@ -158,7 +157,8 @@ def get_date_from_name(self, name):
return self.get_date(name)

def get_branch_commits(self, branch):
return self.get_hashes_from_range("ancestors({0})".format(self.get_branch_name(branch)))
return self.get_hashes_from_range("ancestors({0})".format(self.get_branch_name(branch)),
followfirst=True)

def get_revisions(self, commits):
revisions = {}
Expand Down

0 comments on commit 285f9ac

Please sign in to comment.