diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -179,6 +179,12 @@ class branchcache(dict): def branchtip(self, branch): return self._branchtip(self[branch])[0] + def branchheads(self, branch, closed=False): + heads = self[branch] + if not closed: + heads = [h for h in heads if h not in self._closednodes] + return heads + def copy(self): """return an deep copy of the branchcache object""" return branchcache(self, self.tipnode, self.tiprev, self.filteredhash,