Mercurial > hg
diff tests/simplestorerepo.py @ 39785:979e9f124caa
filelog: stop proxying headrevs() (API)
The previous commit removed the last user of this method. It is
redundant with heads() and adds little to no value other than
convenience. Let's nuke it.
Differential Revision: https://phab.mercurial-scm.org/D4663
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 18 Sep 2018 19:26:44 -0700 |
parents | b63dee7bd0d9 |
children | 68282a7b29a7 |
line wrap: on
line diff
--- a/tests/simplestorerepo.py Tue Sep 18 19:00:17 2018 -0700 +++ b/tests/simplestorerepo.py Tue Sep 18 19:26:44 2018 -0700 @@ -564,18 +564,6 @@ revision=revision, delta=delta) - def headrevs(self): - # Assume all revisions are heads by default. - revishead = {rev: True for rev in self._indexbyrev} - - for rev, entry in self._indexbyrev.items(): - # Unset head flag for all seen parents. - revishead[self.rev(entry[b'p1'])] = False - revishead[self.rev(entry[b'p2'])] = False - - return [rev for rev, ishead in sorted(revishead.items()) - if ishead] - def heads(self, start=None, stop=None): # This is copied from revlog.py. if start is None and stop is None: @@ -628,8 +616,8 @@ heads = {} futurelargelinkrevs = set() - for head in self.headrevs(): - headlinkrev = self.linkrev(head) + for head in self.heads(): + headlinkrev = self.linkrev(self.rev(head)) heads[head] = headlinkrev if headlinkrev >= minlink: futurelargelinkrevs.add(headlinkrev)