Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 16:03:19 +0900] rev 36520
templatekw: add compatdict() as a replacement for showdict()
This is mostly a copy of showdict(), which will be deprecated later. See
the docstring for why it's called a "compat" dict.
showenvvars() is ported to the new API as an example.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 15:43:35 +0900] rev 36519
templatekw: pass templater to _showlist() by an explicit argument
Prepares for switching to the (context, mapping) API.
Yuya Nishihara <yuya@tcha.org> [Fri, 22 Dec 2017 21:59:38 +0900] rev 36518
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.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 14:42:18 +0900] rev 36517
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.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 16:36:38 +0900] rev 36516
templatekw: inline getfiles()
It's just three lines. We don't need a separate function for that.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 16:35:34 +0900] rev 36515
templatekw: factor out function to build a list of files per status
Removes copy-paste code before switching to the (context, mapping) API.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 13:40:46 +0900] rev 36514
templatekw: switch non-showlist template keywords to new API
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 14:28:32 +0900] rev 36513
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.
Sascha Nemecek <nemecek@wienfluss.net> [Wed, 28 Feb 2018 16:24:39 +0100] rev 36512
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)
Yuya Nishihara <yuya@tcha.org> [Sun, 07 Jan 2018 11:53:07 +0900] rev 36511
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.
Yuya Nishihara <yuya@tcha.org> [Wed, 21 Feb 2018 21:14:05 +0900] rev 36510
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.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Feb 2018 11:53:26 +0900] rev 36509
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.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Feb 2018 10:58:15 +0900] rev 36508
cmdutil: reorder optional arguments passed to makefileobj()
**props will be passed directly to templater.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Feb 2018 10:54:24 +0900] rev 36507
cmdutil: strip "%m" pattern (first line of commit message) from both ends
This matches the behavior of the template keyword {desc}.
Yuya Nishihara <yuya@tcha.org> [Tue, 27 Feb 2018 22:37:57 +0900] rev 36506
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().
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 04:50:22 -0500] rev 36505
fileset: drop bad "elif:" trying to check invalid size expression
Since str.isdigit is a function, the last "elif" was always true. An invalid
expression is rejected by util.sizetoint(), so we don't need "elif".
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 08:55:39 -0500] rev 36504
py3: fix test-command-template.t to write files in binary mode
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 08:45:34 -0500] rev 36503
py3: use bytestr() to coerce position carried by ParseError to string
The position value is either int or byte string.
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 08:38:39 -0500] rev 36502
py3: use bytes.endswith('\n') to strip off '\n' from debug color output
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 08:19:47 -0500] rev 36501
py3: fix type of attribute names forwarded by templatekw._hybrid
# skip-blame because just r'' prefixes
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 06:47:06 -0500] rev 36500
py3: move between bytes and unicode when re-raising IOError
IOError is a Python exception, which argument must be a system string.
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 06:43:13 -0500] rev 36499
py3: use '%d' to format diffstat sum
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 06:40:09 -0500] rev 36498
py3: make regexp literal bytes in templatefilters.py
# skip-blame because just b'' prefixes
Yuya Nishihara <yuya@tcha.org> [Thu, 01 Mar 2018 06:38:37 -0500] rev 36497
templatefilters: use encoding.unifromlocal/unitolocal() for py3 compatibility