Commits

David Wilhelm committed 74f375b

history: include branch heads in heads filter

Match the `hg heads` change in Mercurial 1.5

Comments (0)

Files changed (2)

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")

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.