# HG changeset patch # User Yuya Nishihara # Date 1302397302 -32400 # Node ID ea726c97c1b69ee43b4fd15135a205c41847a5b4 # Parent 2176c5babd53634b732ddc2fe83d2c7672d50cb3 hgweb: add bookmarks listing to summary page of gitweb/monoblue styles diff -r 2176c5babd53 -r ea726c97c1b6 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Sun Apr 10 10:01:39 2011 +0900 +++ b/mercurial/hgweb/webcommands.py Sun Apr 10 10:01:42 2011 +0900 @@ -460,6 +460,15 @@ node=hex(n), date=web.repo[n].date()) + def bookmarks(**map): + parity = paritygen(web.stripecount) + b = web.repo._bookmarks.items() + for k, n in sorted(b)[:10]: # limit to 10 bookmarks + yield {'parity': parity.next(), + 'bookmark': k, + 'date': web.repo[n].date(), + 'node': hex(n)} + def branches(**map): parity = paritygen(web.stripecount) @@ -504,6 +513,7 @@ owner=get_contact(web.config) or "unknown", lastchange=tip.date(), tags=tagentries, + bookmarks=bookmarks, branches=branches, shortlog=changelist, node=tip.hex(), diff -r 2176c5babd53 -r ea726c97c1b6 mercurial/templates/gitweb/summary.tmpl --- a/mercurial/templates/gitweb/summary.tmpl Sun Apr 10 10:01:39 2011 +0900 +++ b/mercurial/templates/gitweb/summary.tmpl Sun Apr 10 10:01:42 2011 +0900 @@ -50,6 +50,12 @@ ... +
bookmarks
+ +{bookmarks%bookmarkentry} + +
...
+
branches
{branches%branchentry} diff -r 2176c5babd53 -r ea726c97c1b6 mercurial/templates/monoblue/summary.tmpl --- a/mercurial/templates/monoblue/summary.tmpl Sun Apr 10 10:01:39 2011 +0900 +++ b/mercurial/templates/monoblue/summary.tmpl Sun Apr 10 10:01:42 2011 +0900 @@ -58,6 +58,14 @@
+

Bookmarks

+ + {bookmarks%bookmarkentry} + + + +
...
+ {branches%branchentry} diff -r 2176c5babd53 -r ea726c97c1b6 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Sun Apr 10 10:01:39 2011 +0900 +++ b/tests/test-hgweb-commands.t Sun Apr 10 10:01:42 2011 +0900 @@ -723,6 +723,30 @@
...
+
bookmarks
+ + + + + + + + + + + + + +
1970-01-01anotherthing
1970-01-01something
...
+
branches