Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 16:19:53 +0530] rev 36448
py3: use email.utils module instead of email.Utils
On py2:
>>> import email
>>> import email.utils as eutil
>>> email.Utils.parseaddr is eutil.parseaddr
True
>>> email.Utils.formatdate is eutil.formatdate
True
email.Utils is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2453
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 17:25:46 +0530] rev 36447
py3: slice over bytes or use .startswith() to prevent getting ascii values
Differential Revision: https://phab.mercurial-scm.org/D2457
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 26 Feb 2018 16:23:12 +0530] rev 36446
py3: use '%d' for integers instead of '%s'
Differential Revision: https://phab.mercurial-scm.org/D2455
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 13:24:35 +0900] rev 36445
templatekw: add 'requires' flag to switch to exception-safe interface
The current templatekw interface, f(repo, ctx, templ, **args), is horrible
because it's quite easy to encounter TypeError, ValueError, etc. It's also
bad for Python 3 porting due to the **kwargs issue.
This patch introduces a flag to switch to new f(context, mapping) API seen
in templater functions. The requirement spec isn't verified (yet) because
context.resource() can gracefully raise a ResourceUnavailable exception,
but it's planned to be used as a filter in the help, such as "Revision
Keywords" (if 'ctx' in requires), "File Keywords" (if 'fctx' in requires),
etc.
showauthor() is ported to the new API as an example. 20 more follows.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 12:50:30 +0900] rev 36444
templater: specialize ResourceUnavailable error so that it can be caught
See the next patch how it will be used.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 12:47:53 +0900] rev 36443
templater: move specialized exception types to top
I'm going to add one more exception type.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 14:14:33 +0900] rev 36442
templatekw: minimize resource dependency of {envvars} and {termwidth}
These keywords can be evaluated without a repo.
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Feb 2018 14:12:34 +0900] rev 36441
templatekw: simply override {graphwidth} function by mapping variable