templatekw: pass templater to _showlist() by an explicit argument
Prepares for switching to the (context, mapping) API.
hgweb: make templater mostly compatible with log templates
Prepares for gradually switching templatekw.showsuccsandmarkers() to new API.
This was a PoC showing how to reuse templatekw functions in hgweb. We could
remove rev, node, author, etc. from the commonentry() table, but we'll have
to carefully remove all corresponding symbols from webcommands.*(). Otherwise,
we would face the
issue5612.
Still templatekw.keywords aren't exported. Otherwise some tests would fail
because the atom template expects {files} to be empty in filelog, but
templatekw.showfiles() provides the {files} implementation.
log: do not invoke templatekw.showobsfate() as a function
Prepares for switching to the (context, mapping) API. I tried, but it appeared
not an one-off change to extract a non-template function from showobsfate(),
which deeply depends on the templater internals.
templatekw: inline getfiles()
It's just three lines. We don't need a separate function for that.
templatekw: factor out function to build a list of files per status
Removes copy-paste code before switching to the (context, mapping) API.
templatekw: extract non-templatekw function as getgraphnode()
Prepares for switching to the (context, mapping) API. We still need (repo, ctx)
function for the fast path.
convert: avoid closing ui.fout in subversion code (
issue5807)
Don't close 'fp' (= 'ui.fout') stream to prevent 'ValueError: I/O
operation on closed file' (Bug #5807).
Regression of changeset 30261:
6bed17ba00a1
(https://www.mercurial-scm.org/repo/hg/rev/
6bed17ba00a1)
cmdutil: expand filename format string by templater (BC)
This is BC because '{}' could be a valid filename before, but I believe good
programmers wouldn't use such catastrophic output filenames. On the other
hand, '\' has to be escaped since it is a directory separator on Windows.
Thanks to Matt Harbison for spotting this weird issue.
This patch also adds cmdutil.rendertemplate(ctx, tmpl, props) as a simpler
way of expanding template against single changeset.
.. bc::
'{' in output filename passed to archive/cat/export is taken as a start
of a template expression.
annotate: do not poorly split lines at CR (
issue5798)
mdiff and lines(text) take only LF as a line separator, but str.splitlines()
breaks our assumption. Use mdiff.splitnewlines() consistently.
It's hard to read \r in tests, so \r is replaced with [CR]. I had to wrap
sed by a shell function to silence check-code warning.