formatter: add support for changeset templating
Some formatter-based commands provide fields that are identical to the ones
defined in templatekw, but we had to specify them manually to support all
changeset-based template keywords.
This patch adds fm.context() that populates all templatekw. These keywords
are available only in template output, so we still need to set important
keywords via fm.data() if they should be available in e.g. JSON output.
Currently fm.context() takes only 'ctx' argument. It will eventually be
extended to take 'fctx' to support file-based keywords (e.g. {path}) seen
in hgweb.
templatekw: move defaulttmpl constant from changeset_templater
These templates are used when rendering inner lists of some template keywords,
so it makes sense to define them in templatekw. This allows us to reuse them
to create a templateformatter knowing changectx.
formatter: drop filters argument from maketemplater()
It's unused now. I want to keep the high-level API simple.
templater: port formatnode filter from changeset_templater
This slightly reduces the difference between changeset_templater and formatter,
and helps extending formatter to support changeset templating.
New formatnode() is not a template filter, but a function since a filter
cannot access to ui. And it's marked as DEPRECATED since I think it exists
only for compatibility reasons.
update: allow setting default update check to "noconflict"
The new value allows update (linear or not) as long as they don't
result in file merges.
I'm hoping that this value can some day become the default.
update: add experimental config for default way of handling dirty wdir
This allows the user to set e.g. experimental.updatecheck=abort to
abort update if the working directory is dirty, but still be able to
override the behavior with e.g. --merge when needed.
I considered adding a --mergelinear option to get back the old
behavior even when experimental.updatecheck=abort is set, but I
couldn't see why anyone would prefer that over --merge.
The default is read in hg.updatetotally(), which means it also applies
to "hg pull -u" and "hg unbundle -u".
update: accept --merge to allow merging across topo branches (
issue5125)