mercurial/branchmap.py
changeset 34074 abf91c4f9608
parent 33663 1814ca418b30
child 34370 d0db41af73c0
--- a/mercurial/branchmap.py	Sun Sep 03 21:17:25 2017 +0900
+++ b/mercurial/branchmap.py	Thu Aug 31 18:24:08 2017 +0300
@@ -211,10 +211,13 @@
         Raise KeyError for unknown branch.'''
         return self._branchtip(self[branch])[0]
 
+    def iteropen(self, nodes):
+        return (n for n in nodes if n not in self._closednodes)
+
     def branchheads(self, branch, closed=False):
         heads = self[branch]
         if not closed:
-            heads = [h for h in heads if h not in self._closednodes]
+            heads = list(self.iteropen(heads))
         return heads
 
     def iterbranches(self):