Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
39784:be0f32ca2671 | 39785:979e9f124caa |
---|---|
562 flags=self.flags(rev) | extraflags, | 562 flags=self.flags(rev) | extraflags, |
563 baserevisionsize=baserevisionsize, | 563 baserevisionsize=baserevisionsize, |
564 revision=revision, | 564 revision=revision, |
565 delta=delta) | 565 delta=delta) |
566 | 566 |
567 def headrevs(self): | |
568 # Assume all revisions are heads by default. | |
569 revishead = {rev: True for rev in self._indexbyrev} | |
570 | |
571 for rev, entry in self._indexbyrev.items(): | |
572 # Unset head flag for all seen parents. | |
573 revishead[self.rev(entry[b'p1'])] = False | |
574 revishead[self.rev(entry[b'p2'])] = False | |
575 | |
576 return [rev for rev, ishead in sorted(revishead.items()) | |
577 if ishead] | |
578 | |
579 def heads(self, start=None, stop=None): | 567 def heads(self, start=None, stop=None): |
580 # This is copied from revlog.py. | 568 # This is copied from revlog.py. |
581 if start is None and stop is None: | 569 if start is None and stop is None: |
582 if not len(self): | 570 if not len(self): |
583 return [nullid] | 571 return [nullid] |
626 brokenrevs = set() | 614 brokenrevs = set() |
627 strippoint = len(self) | 615 strippoint = len(self) |
628 | 616 |
629 heads = {} | 617 heads = {} |
630 futurelargelinkrevs = set() | 618 futurelargelinkrevs = set() |
631 for head in self.headrevs(): | 619 for head in self.heads(): |
632 headlinkrev = self.linkrev(head) | 620 headlinkrev = self.linkrev(self.rev(head)) |
633 heads[head] = headlinkrev | 621 heads[head] = headlinkrev |
634 if headlinkrev >= minlink: | 622 if headlinkrev >= minlink: |
635 futurelargelinkrevs.add(headlinkrev) | 623 futurelargelinkrevs.add(headlinkrev) |
636 | 624 |
637 # This algorithm involves walking down the rev graph, starting at the | 625 # This algorithm involves walking down the rev graph, starting at the |