# HG changeset patch # User Brodie Rao # Date 1379318909 25200 # Node ID 3a37278296073cbe0585f3ffc29c42b4cbf563fc # Parent 4d6d5ef885384feb3178e9d799e4b22da3b1e7d0 branchmap: introduce branchheads() method diff -r 4d6d5ef88538 -r 3a3727829607 mercurial/branchmap.py --- a/mercurial/branchmap.py Mon Sep 16 01:08:29 2013 -0700 +++ b/mercurial/branchmap.py Mon Sep 16 01:08:29 2013 -0700 @@ -179,6 +179,12 @@ 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,