Commits

David Wilhelm committed 74f375b

history: include branch heads in heads filter

Match the `hg heads` change in Mercurial 1.5

  • Participants
  • Parent commits ef28344
  • Branches stable

Comments (0)

Files changed (2)

File tortoisehg/hgtk/history.py

             filtertext += _("Parents")
         elif self.filter == 'heads':
             ftitle(_('heads'))
-            heads = [self.repo[x].rev() for x in self.repo.heads()]
+            heads = hglib.getlivebheads(self.repo)
             opts['revlist'] = [str(x) for x in heads]
             self.graphview.refresh(False, [], opts)
             filtertext += _("Heads")

File tortoisehg/util/hglib.py

         lives.append(branch.replace('\0', ''))
     return lives
 
+def getlivebheads(repo):
+    '''return a list of revs of live branch heads'''
+    bheads = []
+    for b, ls in repo.branchmap().iteritems():
+        bheads += [repo[x] for x in ls]
+    heads = [x.rev() for x in bheads if not x.extra().get('close')]
+    heads.sort()
+    heads.reverse()
+    return heads
+
 _hidetags = None
 def gethidetags(ui):
     global _hidetags