diff mercurial/hgweb/hgweb_mod.py @ 3499:e0db0b7934f2

hgweb: add heads to gitweb summary
author Brendan Cully <brendan@kublai.com>
date Tue, 24 Oct 2006 13:31:01 -0700
parents 8f02223662c8
children 881064004fd0
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Tue Oct 24 13:17:41 2006 -0700
+++ b/mercurial/hgweb/hgweb_mod.py	Tue Oct 24 13:31:01 2006 -0700
@@ -527,6 +527,23 @@
                              date = t)
                 parity += 1
 
+        def heads(**map):
+            parity = 0
+            count = 0
+
+            for node in self.repo.heads():
+                count += 1
+                if count > 10:
+                    break;
+
+                ctx = self.repo.changectx(node)
+
+                yield {'parity': self.stripes(parity),
+                       'branch': ctx.branch(),
+                       'node': hex(node),
+                       'date': ctx.date()}
+                parity += 1
+
         def changelist(**map):
             parity = 0
             cl = self.repo.changelog
@@ -560,6 +577,7 @@
                           self.repo.ui.config("web", "author", "unknown")), # also
                  lastchange = cl.read(cl.tip())[2],
                  tags = tagentries,
+                 heads = heads,
                  shortlog = changelist,
                  node = hex(cl.tip()),
                  archives=self.archivelist("tip"))