diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -21,8 +21,8 @@ from mercurial.i18n import _
__all__ = [
'log', 'rawfile', 'file', 'changelog', 'shortlog', 'changeset', 'rev',
- 'manifest', 'tags', 'branches', 'summary', 'filediff', 'diff', 'annotate',
- 'filelog', 'archive', 'static', 'graph', 'help',
+ 'manifest', 'tags', 'bookmarks', 'branches', 'summary', 'filediff', 'diff',
+ 'annotate', 'filelog', 'archive', 'static', 'graph', 'help',
]
def log(web, req, tmpl):
@@ -389,6 +389,30 @@ def tags(web, req, tmpl):
entriesnotip=lambda **x: entries(True, 0, **x),
latestentry=lambda **x: entries(True, 1, **x))
+def bookmarks(web, req, tmpl):
+ i = web.repo._bookmarks.items()
+ i.reverse()
+ parity = paritygen(web.stripecount)
+
+ def entries(notip=False, limit=0, **map):
+ count = 0
+ for k, n in i:
+ if notip and k == "tip":
+ continue
+ if limit > 0 and count >= limit:
+ continue
+ count = count + 1
+ yield {"parity": parity.next(),
+ "bookmark": k,
+ "date": web.repo[n].date(),
+ "node": hex(n)}
+
+ return tmpl("bookmarks",
+ node=hex(web.repo.changelog.tip()),
+ entries=lambda **x: entries(False, 0, **x),
+ entriesnotip=lambda **x: entries(True, 0, **x),
+ latestentry=lambda **x: entries(True, 1, **x))
+
def branches(web, req, tmpl):
tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems())
heads = web.repo.heads()
@@ -726,7 +750,8 @@ def graph(web, req, tmpl):
user = cgi.escape(templatefilters.person(ctx.user()))
branch = ctx.branch()
branch = branch, web.repo.branchtags().get(branch) == ctx.node()
- data.append((node, vtx, edges, desc, user, age, branch, ctx.tags(), ctx.bookmarks()))
+ data.append((node, vtx, edges, desc, user, age, branch, ctx.tags(),
+ ctx.bookmarks()))
return tmpl('graph', rev=rev, revcount=revcount, uprev=uprev,
lessvars=lessvars, morevars=morevars, downrev=downrev,
diff --git a/mercurial/templates/paper/bookmarks.tmpl b/mercurial/templates/paper/bookmarks.tmpl
new file mode 100644
--- /dev/null
+++ b/mercurial/templates/paper/bookmarks.tmpl
@@ -0,0 +1,49 @@
+{header}
+
{repo|escape}: bookmarks
+
+
+
+
+
+
+
+
+
+
+
bookmarks
+
+
+
+
+
+ bookmark
+ node
+
+{entries%bookmarkentry}
+
+
+
+
+{footer}
diff --git a/mercurial/templates/paper/branches.tmpl b/mercurial/templates/paper/branches.tmpl
--- a/mercurial/templates/paper/branches.tmpl
+++ b/mercurial/templates/paper/branches.tmpl
@@ -17,6 +17,7 @@
log
graph
tags
+bookmarks
branches
diff --git a/mercurial/templates/paper/changeset.tmpl b/mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl
+++ b/mercurial/templates/paper/changeset.tmpl
@@ -12,6 +12,7 @@
log
graph
tags
+ bookmarks
branches
diff --git a/mercurial/templates/paper/error.tmpl b/mercurial/templates/paper/error.tmpl
--- a/mercurial/templates/paper/error.tmpl
+++ b/mercurial/templates/paper/error.tmpl
@@ -13,6 +13,7 @@
log
graph
tags
+bookmarks
branches
help
diff --git a/mercurial/templates/paper/fileannotate.tmpl b/mercurial/templates/paper/fileannotate.tmpl
--- a/mercurial/templates/paper/fileannotate.tmpl
+++ b/mercurial/templates/paper/fileannotate.tmpl
@@ -13,6 +13,7 @@
log
graph
tags
+bookmarks
branches
diff --git a/mercurial/templates/paper/filediff.tmpl b/mercurial/templates/paper/filediff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl
+++ b/mercurial/templates/paper/filediff.tmpl
@@ -13,6 +13,7 @@
log
graph
tags
+bookmarks
branches
diff --git a/mercurial/templates/paper/filelog.tmpl b/mercurial/templates/paper/filelog.tmpl
--- a/mercurial/templates/paper/filelog.tmpl
+++ b/mercurial/templates/paper/filelog.tmpl
@@ -17,6 +17,7 @@
log
graph
tags
+bookmarks
branches
diff --git a/mercurial/templates/paper/graph.tmpl b/mercurial/templates/paper/graph.tmpl
--- a/mercurial/templates/paper/graph.tmpl
+++ b/mercurial/templates/paper/graph.tmpl
@@ -18,6 +18,7 @@
log
graph
tags
+bookmarks
branches
diff --git a/mercurial/templates/paper/help.tmpl b/mercurial/templates/paper/help.tmpl
--- a/mercurial/templates/paper/help.tmpl
+++ b/mercurial/templates/paper/help.tmpl
@@ -17,6 +17,7 @@
log
graph
tags
+bookmarks
branches
diff --git a/mercurial/templates/paper/helptopics.tmpl b/mercurial/templates/paper/helptopics.tmpl
--- a/mercurial/templates/paper/helptopics.tmpl
+++ b/mercurial/templates/paper/helptopics.tmpl
@@ -17,6 +17,7 @@
log
graph
tags
+bookmarks
branches
diff --git a/mercurial/templates/paper/manifest.tmpl b/mercurial/templates/paper/manifest.tmpl
--- a/mercurial/templates/paper/manifest.tmpl
+++ b/mercurial/templates/paper/manifest.tmpl
@@ -13,6 +13,7 @@
log
graph
tags
+bookmarks
branches