[PATCH] gitweb: Display branch and tag labels

Thomas Arendsen Hein thomas at intevation.de
Sat Jun 2 05:49:21 CDT 2007


* Josef 'Jeff' Sipek <jeffpc at josefsipek.net> [20070602 02:03]:
> # User Josef "Jeff" Sipek <jeffpc at josefsipek.net>
> # Date 1180742199 14400
> # Node ID d46d3197a5d199679067557b23558b8bdce1acd8
> # Parent  e8a5840678255657d3b97cc1215a005aac061ede
> gitweb: Display branch and tag labels

I like it and I hope a corresponding change for hgweb would come
soon, too.

> +    def taglistdict(self,node):
> +        return [{"name":i} for i in self.repo.nodetags(node)]

spacing issues, e.g. (self, node) and {"name": i}

And maybe call it nodetagsdict, because it yields a dict with the
result of nodetags.

> +    def branchlistdict(self,node):
> +        l=[]
> +        for t, tn in self.repo.branchtags().items():
> +            if tn == node:
> +                l.append({"name":t})
> +        return l

The branch of a changeset (there can only be one!) can easily be
read by using ctx.branch() ... no need to go the long way.

Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial-devel mailing list