On 16 May 2010 18:19:32 -0500, Steve Borho wrote: > Can you move this functionality to tortoisehg/util/hglib.py, right > after 'getlivebranch()'?
Thanks. Something like this?
# HG changeset patch # User David Wilhelm <d...@jumbledpile.com> # Date 1274055575 25200 # Node ID d0c9b173f3db430f264b9cb53ac8b830b79a098e # Parent a2463ff6ee5be88a34dd520fe77cd1efffb524c9 history: include branch heads in heads filter Match the `hg heads` change in Mercurial 1.5 diff --git a/tortoisehg/hgtk/history.py b/tortoisehg/hgtk/history.py --- a/tortoisehg/hgtk/history.py +++ b/tortoisehg/hgtk/history.py @@ -1184,7 +1184,7 @@ 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") diff --git a/tortoisehg/util/hglib.py b/tortoisehg/util/hglib.py --- a/tortoisehg/util/hglib.py +++ b/tortoisehg/util/hglib.py @@ -120,6 +120,16 @@ 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
------------------------------------------------------------------------------
_______________________________________________ Tortoisehg-develop mailing list Tortoisehg-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop