diff mercurial/hgweb/hgweb_mod.py @ 4476:d46d3197a5d1 default tip

gitweb: Display branch and tag labels Pages which display labels: - summary - shortlog - changelog - changeset - search
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Fri, 01 Jun 2007 19:56:39 -0400
parents 8af65bc092b0
children
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Fri Jun 01 14:07:42 2007 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Fri Jun 01 19:56:39 2007 -0400
@@ -133,6 +133,16 @@
             return [dict(file=r[0], node=hex(r[1]))]
         return []
 
+    def taglistdict(self,node):
+        return [{"name":i} for i in self.repo.nodetags(node)]
+
+    def branchlistdict(self,node):
+        l=[]
+        for t, tn in self.repo.branchtags().items():
+            if tn == node:
+                l.append({"name":t})
+        return l
+
     def showtag(self, t1, node=nullid, **args):
         for t in self.repo.nodetags(node):
             yield self.t(t1, tag=t, **args)
@@ -211,7 +221,9 @@
                              "date": ctx.date(),
                              "files": self.listfilediffs(ctx.files(), n),
                              "rev": i,
-                             "node": hex(n)})
+                             "node": hex(n),
+                             "tags": self.taglistdict(n),
+                             "branches": self.branchlistdict(n)})
 
             for e in l:
                 yield e
@@ -274,7 +286,9 @@
                              date=ctx.date(),
                              files=self.listfilediffs(ctx.files(), n),
                              rev=ctx.rev(),
-                             node=hex(n))
+                             node=hex(n),
+                             tags=self.taglistdict(n),
+                             branches=self.branchlistdict(n))
 
                 if count >= self.maxchanges:
                     break
@@ -314,7 +328,9 @@
                      desc=ctx.description(),
                      date=ctx.date(),
                      files=files,
-                     archives=self.archivelist(hex(n)))
+                     archives=self.archivelist(hex(n)),
+                     tags=self.taglistdict(n),
+                     branches=self.branchlistdict(n))
 
     def filelog(self, fctx):
         f = fctx.path()
@@ -482,7 +498,9 @@
                      upparity=parity.next(),
                      fentries=filelist,
                      dentries=dirlist,
-                     archives=self.archivelist(hex(node)))
+                     archives=self.archivelist(hex(node)),
+                     tags=self.taglistdict(node),
+                     branches=self.branchlistdict(node))
 
     def tags(self):
         i = self.repo.tagslist()
@@ -545,7 +563,8 @@
             l = [] # build a list in forward order for efficiency
             for i in xrange(start, end):
                 ctx = self.repo.changectx(i)
-                hn = hex(ctx.node())
+                n = ctx.node()
+                hn = hex(n)
 
                 l.insert(0, self.t(
                     'shortlogentry',
@@ -554,7 +573,9 @@
                     desc=ctx.description(),
                     date=ctx.date(),
                     rev=i,
-                    node=hn))
+                    node=hn,
+                    tags=self.taglistdict(n),
+                    branches=self.branchlistdict(n)))
 
             yield l