Mercurial > hg
comparison mercurial/localrepo.py @ 20189:1831993d0902
localrepo: refactor repo.branchheads() to use repo.branchmap().branchheads()
author | Brodie Rao <brodie@sf.io> |
---|---|
date | Mon, 16 Sep 2013 01:08:29 -0700 |
parents | 4d6d5ef88538 |
children | 4274eda143cb |
comparison
equal
deleted
inserted
replaced
20188:3a3727829607 | 20189:1831993d0902 |
---|---|
1626 branch = self[None].branch() | 1626 branch = self[None].branch() |
1627 branches = self.branchmap() | 1627 branches = self.branchmap() |
1628 if branch not in branches: | 1628 if branch not in branches: |
1629 return [] | 1629 return [] |
1630 # the cache returns heads ordered lowest to highest | 1630 # the cache returns heads ordered lowest to highest |
1631 bheads = list(reversed(branches[branch])) | 1631 bheads = list(reversed(branches.branchheads(branch, closed=closed))) |
1632 if start is not None: | 1632 if start is not None: |
1633 # filter out the heads that cannot be reached from startrev | 1633 # filter out the heads that cannot be reached from startrev |
1634 fbheads = set(self.changelog.nodesbetween([start], bheads)[2]) | 1634 fbheads = set(self.changelog.nodesbetween([start], bheads)[2]) |
1635 bheads = [h for h in bheads if h in fbheads] | 1635 bheads = [h for h in bheads if h in fbheads] |
1636 if not closed: | |
1637 bheads = [h for h in bheads if not self[h].closesbranch()] | |
1638 return bheads | 1636 return bheads |
1639 | 1637 |
1640 def branches(self, nodes): | 1638 def branches(self, nodes): |
1641 if not nodes: | 1639 if not nodes: |
1642 nodes = [self.changelog.tip()] | 1640 nodes = [self.changelog.tip()] |