sapling/mercurial/templates
Gregory Szorc f621d5ad49 show: show all namespaces in "work" view
This commit addresses a number of deficiencies in `hg show work`'s
output:

* Failure to render tags (it just wasn't implemented)
* Failure to render names associated with non-built-in namespaces
  (e.g. remotenames)
* Color names were hardcoded instead of coming from the canonical
  source in the namespace

This change has the intended effect of rendering tags and extra
namespaces. It solves an immediate need at Mozilla of having
names from a custom namespace printed, which is blocking us from
switching from a custom `hg wip` revset/template combo to `hg show
work`.

Note that the order of branches and bookmarks changes. This is
because bookmarks are registered before branches in namespaces.py.
We may want to register them last, after tags and branches. Or we
may want to added a weighted field to the namespace to control
display order. Something to think about.

I'm not a big fan of the complexity in the templating layer. There
is a lot of code to basically filter out the special case of
branch=='default' and tag=='tip'. Ideally, we would iterate over
a data structure that had irrelevant/unwanted names pre-filtered.
However, I wasn't sure how to best implement this. We probably
want {namespaces} to emit everything (its current behavior). I
was toying with the following:

* {namespacesnondefaults} variation that filtered values
* A filter function that operated on {namespaces} (I wasn't sure
  how to implement this since the filtering layer would see a
  "hybrid" instance as opposed to something that was definitely
  an iterable of namespaces.)
* A namespaces(...) function where you could specify which values
  to return. I like this the most. But it really wants named
  arguments to control filtering and we only support named arguments
  on revsets, not templates.

I figure perfect is the enemy of good and we can refine templating
support for namespaces in the future. At least now we have a
concrete example of a use case.
2017-06-24 15:11:05 -07:00
..
atom hgweb: reindent atom/changelogentry.tmpl 2016-06-29 22:48:32 +08:00
coal coal: use inheritance to derive from paper 2016-08-17 13:43:13 -05:00
gitweb hgweb: plug followlines action in annotate view 2017-06-21 17:17:17 +02:00
json hgweb: expose list of per-repo labels to templates 2016-06-30 18:59:53 -07:00
monoblue hgweb: consolidate search form for monoblue 2017-06-09 13:41:10 -07:00
paper hgweb: plug followlines action in annotate view 2017-06-21 17:17:17 +02:00
raw hgweb: replace 'shortlog' with 'changelog' in raw changelog template 2013-08-16 21:41:19 +04:00
rss hgweb: add missing slash to file log url in rss style 2016-12-08 23:59:36 +08:00
spartan hgweb: support Content Security Policy 2017-01-10 23:37:08 -08:00
static hgweb: plug followlines action in annotate view 2017-06-21 17:17:17 +02:00
map-cmdline.bisect map-cmdline.bisect: rewrite to just %include the default template 2015-05-10 13:48:10 -04:00
map-cmdline.changelog
map-cmdline.compact compact: add color labels to -Tcompact 2016-04-08 16:05:52 +00:00
map-cmdline.default templates: shorten definition of changeset labels in command-line style 2017-03-28 22:38:45 +02:00
map-cmdline.phases template-phases: extend default style instead of duplicating it 2015-04-25 21:42:07 +09:00
map-cmdline.show show: show all namespaces in "work" view 2017-06-24 15:11:05 -07:00
map-cmdline.status log: fix status template to list copy source per dest (issue5155) 2016-03-24 22:55:56 +09:00
map-cmdline.xml templater: add new docheader/footer components for XML (issue4135) 2015-08-26 16:27:14 -05:00