diff mercurial/templater.py @ 3461:451ec905625b

Add new branch info to templater and use it in map-cmdline.default. The template currently shows old (hg log -b style) branch tags, too, but not in the same way as the built in changeset_printer.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 18 Oct 2006 17:58:51 +0200
parents bc5985d53386
children fab28100ea88
line wrap: on
line diff
--- a/mercurial/templater.py	Wed Oct 18 12:26:12 2006 +0200
+++ b/mercurial/templater.py	Wed Oct 18 17:58:51 2006 +0200
@@ -431,14 +431,15 @@
             if endname in self.t:
                 yield self.t(endname, **args)
 
-        if brinfo:
-            def showbranches(**args):
-                if changenode in brinfo:
-                    for x in showlist('branch', brinfo[changenode],
-                                      plural='branches', **args):
-                        yield x
-        else:
-            showbranches = ''
+        def showbranches(**args):
+            branch = changes[5].get("branch")
+            if branch:
+                yield showlist('branch', [branch], plural='branches', **args)
+            # add old style branches if requested
+            if brinfo and changenode in brinfo:
+                for x in showlist('branch', brinfo[changenode],
+                                  plural='branches', **args):
+                    yield x
 
         if self.ui.debugflag:
             def showmanifest(**args):