Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 29471:c4fc33c477da
hgweb: expose list of per-repo labels to templates
hgweb currently offers limited functionality for "classifying"
repositories. This patch aims to change that.
The web.labels config option list is introduced. Its values
are exposed to the "index" and "summary" templates. Custom
templates can use template features like ifcontains() to e.g.
look for the presence of a specific label and engage specific
behavior. For example, a site operator may wish to assign a
"defunct" label to a repository so the repository is prominently
marked as dead in repository indexes.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 30 Jun 2016 18:59:53 -0700 |
parents | f694e20193f2 |
children | 9c37df347485 |
comparison
equal
deleted
inserted
replaced
29470:2ff243c415b4 | 29471:c4fc33c477da |
---|---|
723 bookmarks=bookmarks, | 723 bookmarks=bookmarks, |
724 branches=webutil.branchentries(web.repo, web.stripecount, 10), | 724 branches=webutil.branchentries(web.repo, web.stripecount, 10), |
725 shortlog=changelist, | 725 shortlog=changelist, |
726 node=tip.hex(), | 726 node=tip.hex(), |
727 symrev='tip', | 727 symrev='tip', |
728 archives=web.archivelist("tip")) | 728 archives=web.archivelist("tip"), |
729 labels=web.configlist('web', 'labels')) | |
729 | 730 |
730 @webcommand('filediff') | 731 @webcommand('filediff') |
731 def filediff(web, req, tmpl): | 732 def filediff(web, req, tmpl): |
732 """ | 733 """ |
733 /diff/{revision}/{path} | 734 /diff/{revision}/{path} |