filemerge: use new function for getting first line of string
Differential Revision: https://phab.mercurial-scm.org/D12411
absorb: use new function for getting first line of string
Differential Revision: https://phab.mercurial-scm.org/D12410
extensions: use new function for getting first line of string
Differential Revision: https://phab.mercurial-scm.org/D12409
bookmarks: use new function for getting first line of string
Differential Revision: https://phab.mercurial-scm.org/D12408
help: use new function for getting first line of string
Differential Revision: https://phab.mercurial-scm.org/D12407
histedit: remove an unnecessary default value of `b''` for commit message
I don't think `ctx.description()` is ever anything falsy other than
`b''`. I think the comment added in
4c4232e51167 (histedit: extract
common summary code into method, 2016-05-27) is mistaken (I don't see
any code following that pattern before the function was added).
Differential Revision: https://phab.mercurial-scm.org/D12406
histedit: use new function for getting first line of a string
This fixes a crash you can run into if you enter a commit message
that's just a "newline-like" byte, like a form feed byte (`hg ci -m
\x0f` in Fish). That bug is the motivation for this series.
Differential Revision: https://phab.mercurial-scm.org/D12405
templates: extract function to `stringutil` for getting first line of text
It's surprisingly hard to get the first line from a string, so let's
have our own function in `stringutil` for it.
Differential Revision: https://phab.mercurial-scm.org/D12404
templates: make `firstline` filter not keep '\v', '\f' and similar
In
b288b4bb8448 (hide some functions behind lambdas, so demandload is
useful., 2006-02-28), `x.splitlines(1)[0]` was replaced by
`x.splitlines(1)[0].rstrip('\r\n')`, i.e. stripping trailing '\r' and
'\n'. Combined with the "truthy" `1` passed to `splitlines()` to get
it to keep line endings, that results in e.g. trailing '\v' (Line
Tabulation) and '\f' (Form Feed) being preserved. I can't see why one
would want that, and I doubt that was the intention; I suspect the
author just didn't think to instead remove the `1` argument. Perhaps
they thought the 1 being passed there - added by themselves in
a7e416bf3c1d (improve templating., 2006-02-27) - was to limit the
number of splits to 1 (i.e. thinking about it as `maxsplit=1` rather
than `keepends=1`).
Differential Revision: https://phab.mercurial-scm.org/D12403
pytype: drop py3.6 support
Pytype 2022.01.07 only supports 3.7+.
Differential Revision: https://phab.mercurial-scm.org/D12400