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.
templater: add option to parse template string just like raw string literal
This seems a bit odd because the template syntax has no raw string literal
containing template fragments, but is necessary to port filename format string
to templater. See the next patch.
cmdutil: reorder optional arguments passed to makefileobj()
**props will be passed directly to templater.
cmdutil: strip "%m" pattern (first line of commit message) from both ends
This matches the behavior of the template keyword {desc}.
test-acl: mock up util.getuser() to trust $LOGNAME on Windows
The test relies on POSIX-like getuser() behavior, so we can't use
windows.getuser().