diff mercurial/hgweb/webutil.py @ 13596:270f57d35525 stable

hgweb: add display of bookmarks for changelog and changeset
author Alexander Solovyov <alexander@solovyov.net>
date Sat, 12 Mar 2011 11:19:44 +0100
parents 1b1a9038a71a
children bfeaa88b875d
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Sat Mar 12 13:02:03 2011 +0100
+++ b/mercurial/hgweb/webutil.py	Sat Mar 12 11:19:44 2011 +0100
@@ -90,6 +90,9 @@
 def nodetagsdict(repo, node):
     return [{"name": i} for i in repo.nodetags(node)]
 
+def nodebookmarksdict(repo, node):
+    return [{"name": i} for i in repo.nodebookmarks(node)]
+
 def nodebranchdict(repo, ctx):
     branches = []
     branch = ctx.branch()
@@ -118,6 +121,10 @@
     for t in repo.nodetags(node):
         yield tmpl(t1, tag=t, **args)
 
+def showbookmark(repo, tmpl, t1, node=nullid, **args):
+    for t in repo.nodebookmarks(node):
+        yield tmpl(t1, bookmark=t, **args)
+
 def cleanpath(repo, path):
     path = path.lstrip('/')
     return util.canonpath(repo.root, '', path)