Mercurial > hg
comparison mercurial/hgweb/webcommands.py @ 13924:ea726c97c1b6
hgweb: add bookmarks listing to summary page of gitweb/monoblue styles
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 10 Apr 2011 10:01:42 +0900 |
parents | 2176c5babd53 |
children | c3372529247f |
comparison
equal
deleted
inserted
replaced
13923:2176c5babd53 | 13924:ea726c97c1b6 |
---|---|
458 parity=parity.next(), | 458 parity=parity.next(), |
459 tag=k, | 459 tag=k, |
460 node=hex(n), | 460 node=hex(n), |
461 date=web.repo[n].date()) | 461 date=web.repo[n].date()) |
462 | 462 |
463 def bookmarks(**map): | |
464 parity = paritygen(web.stripecount) | |
465 b = web.repo._bookmarks.items() | |
466 for k, n in sorted(b)[:10]: # limit to 10 bookmarks | |
467 yield {'parity': parity.next(), | |
468 'bookmark': k, | |
469 'date': web.repo[n].date(), | |
470 'node': hex(n)} | |
471 | |
463 def branches(**map): | 472 def branches(**map): |
464 parity = paritygen(web.stripecount) | 473 parity = paritygen(web.stripecount) |
465 | 474 |
466 b = web.repo.branchtags() | 475 b = web.repo.branchtags() |
467 l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.iteritems()] | 476 l = [(-web.repo.changelog.rev(n), n, t) for t, n in b.iteritems()] |
502 return tmpl("summary", | 511 return tmpl("summary", |
503 desc=web.config("web", "description", "unknown"), | 512 desc=web.config("web", "description", "unknown"), |
504 owner=get_contact(web.config) or "unknown", | 513 owner=get_contact(web.config) or "unknown", |
505 lastchange=tip.date(), | 514 lastchange=tip.date(), |
506 tags=tagentries, | 515 tags=tagentries, |
516 bookmarks=bookmarks, | |
507 branches=branches, | 517 branches=branches, |
508 shortlog=changelist, | 518 shortlog=changelist, |
509 node=tip.hex(), | 519 node=tip.hex(), |
510 archives=web.archivelist("tip")) | 520 archives=web.archivelist("tip")) |
511 | 521 |