templatefuncs: use evaldate() where seems appropriate
This means date("today") is allowed.
Also fixes evaldate() to forcibly use the custom error message if specified.
templatefilters: declare input type as bytes where appropriate
Some test outputs changed since input is now coerced to a byte string. I
think that's okay. Maybe {date} should have some readable representation?
templatefilters: allow declaration of input data type
Currently filters take an unwrapped value, which should have no hybrid magic
but actually it does because stringify() relies on it. The 'intype' allows
us to pre-process the magic by .e.g. evalstring() keeping filter functions
as simple as they are now.
stringify() is ported as an example. More follow.
hgweb: use registrar to declare "websub" template filter
Prepares for adding 'intype' attribute.
procutil: redirect ui.fout to stderr while stdio is protected
The new behavior seems slightly nicer as we can at least read the output.
And this is similar to what the sshserver is doing, so we can probably
reuse protectstdio() instead of the weird hook.redirect(True) hack.
procutil: unroll uin/uout loop in protectstdio()
I'll change uout to be redirected to stderr.
context: drop support for changeid of type long (API?)
I don't see a reason to support type long. It's pretty much the same
type as int. There was some discussion about it on the mailing list
around the time of
ff2f90503d64 (context: work around `long` not
existing on Python 3, 2017-03-11), but I couldn't find a good reason
to keep it. There was some mention of hgtk doing "repo[long(rev)]",
but that was in 2012.
Differential Revision: https://phab.mercurial-scm.org/D2989
server: minor code cleanup
Suggested by Yuya after
77f9e95fe3c4, this is mostly using named values for
stdio descriptors. The lockfile is also opened in binary mode when reading back
content from the child.