Zachary Dremann
2177dc0657
Allow \0 escape for nulls
...
This allows safely getting e.g. multiple descriptions, and knowing where the
boundaries are
2023-09-14 17:11:05 -04:00
Yuya Nishihara
e3c85d6ecc
revset: convert root symbol to function
...
The idea is that we can fully eliminate special symbols that would otherwise
shadow user branches, tags, or change ID prefixes.
Closes #2095
2023-09-04 10:36:30 +09:00
Yuya Nishihara
4394bf8de8
templater: add boolean literals
...
They are implemented as literal expressions so that user cannot override
them by false and true aliases.
2023-09-03 07:01:40 +09:00
Yuya Nishihara
f422f1300c
templater: move empty signature placeholder to user template
...
This patch also extracts format_detailed_signature() function to deduplicate
the "show" template bits.
The added placeholder templates aren't labeled as "empty". If needed, I think
the whole template can be labeled as "empty" (or "empty_commit") just like
"working_copy".
Closes #2112
2023-08-27 09:38:36 +09:00
Yuya Nishihara
b45da80c12
tests: add more tests for empty signature
...
As I'm going to change the Signature type to not fill out a placeholder
message, we need to test the builtin templates as well.
2023-08-27 09:38:36 +09:00
Yuya Nishihara
88b509f857
tests: do not use "author" template keyword to test string functions
...
I'm going to change the default formatting of empty Signature type, and
these tests should use a non-empty keyword.
2023-08-27 09:38:36 +09:00
Yuya Nishihara
3f7d884d00
templater: fix offset of negative substr() index to be char-based
2023-08-25 22:59:31 +09:00
Zachary Dremann
ac448202da
templates: Add more string methods
...
Add starts_with/ends_with/remove_prefix/remove_suffix/substr methods to string when templating.
2023-08-24 11:24:07 -04:00
Zachary Dremann
9702a425e5
Allow negative numbers in the template grammar
...
This allows negative numbers, which also means functions which took numbers can now take negative numbers
Luckily, they all already handled this exactly as expected.
2023-08-24 11:24:07 -04:00
Emily Fox
2062abdc9d
templates: replace empty name and email strings with placeholders
...
New placeholders say "(no name availalbe)" and "(no email available)",
because empty strings aren't _necessarily_ a configuration issue.
2023-08-18 17:22:59 -05:00
Martin von Zweigbergk
f1b817e8ca
cleanup: fix warnings from nightly clippy
2023-08-14 22:11:56 -07:00
Martin von Zweigbergk
0075174308
tests: move tests/
under cli/
so they're run again
...
Thanks to @ilyagr for noticing that they should be moved.
2023-08-05 06:18:59 +00:00