extdata: avoid crashing inside subprocess when we get a revset parse error
Differential Revision: https://phab.mercurial-scm.org/D6616
extdata: demonstrate bad behavior when a subprocess emits garbage
Differential Revision: https://phab.mercurial-scm.org/D6615
py3: don't run source transformer on hgext3rd (extensions)
It's unclear why the source transformer runs on hgext3rd. It's been
like that since it was introduced in
1c22400db72d (mercurial:
implement a source transforming module loader on Python 3,
2016-07-04), and that commit didn't say anything about it (but it says
that it doesn't have "support [...] for extensions").
I find that the current handling of hgext3rd just makes it harder to
convert extensions to Python 3. It makes you convert a bunch of
strings passed to getattr() and kwargs[] to r'' that could otherwise
have been left alone. It's also really confusing that the source
transformer runs when you import the extension as "extensions.foo=",
but not as "extension.foo=/some/path".
I suppose there is small number of (very simple) extensions that would
have worked without this patch that would now be broken. It seems okay
to me to break those.
Differential Revision: https://phab.mercurial-scm.org/D6614
crecord: provide 'X' as a range-select mechanism
Differential Revision: https://phab.mercurial-scm.org/D6621
crecord: make KEY_ENTER usable in tests (by not updating UI)
Differential Revision: https://phab.mercurial-scm.org/D6620
crecord: fix if -> elif when handling key presses
This shouldn't actually change any behavior, I only noticed it since I started
using KEY_UP in tests, and it was complaining when it got down to the ^L
handler that initscr hadn't been called yet.
Differential Revision: https://phab.mercurial-scm.org/D6619
crecord: add "x" alias for space, remove test-only "TOGGLE" alias
Differential Revision: https://phab.mercurial-scm.org/D6618
crecord: stop using test-only "X" as alternative for "c"
Differential Revision: https://phab.mercurial-scm.org/D6617
graft: moved abortgraft and readgraft to cmdutil
This patch moves `abortgraft` and `readgraft` to
`cmdutil`. Various callers are updated accordingly.
This is done because these serve as ulitlity functions
for command `graft` and so that new functions regarding
graft can be built from them.
Differential Revision: https://phab.mercurial-scm.org/D6608
cleanup: use named constants for second arg to .seek()
Differential Revision: https://phab.mercurial-scm.org/D6556
patch: use a short, fixed-size message for last line of prompt (
issue6158)
See
issue6158 and the previous commit for examples of what might go wrong if we
have some combinations of readline version and terminal and need to wrap the
line.
Briefly: readline may not display the beginning of the last line of the prompt,
or it may print over it with the end of the prompt, making it difficult for
users to know what's going on.
Differential Revision: https://phab.mercurial-scm.org/D6563
filemerge: make last line of prompts <40 english chars (
issue6158)
I've chosen <40 as the target so that other languages that may have a 2x blowup
in character count can still have a chance to fit into an 80 column screen.
Previously, we would show a prompt like:
```
keep (l)ocal [dest], take (o)ther [source], or leave (u)nresolved for some/potentially/really/long/path?
```
On at least some systems, if readline was in use then the last line of the
prompt would be wrapped strangely if it couldn't fit entirely on one line. This
strange wrapping may be just a carriage return without a line feed, overwriting
the beginning of the line; example (100 columns wide, 65 character filename, and
yes there's 10 spaces on the end, I assume this is to handle the user inputting
longest word we provide as an option, "unresolved"):
```
ng/dir/name/that/does/not/work/well/with/readline/file.txt? ave (u)nresolved for some/lon
```
In some cases it may partially wrap onto the next line, but still be missing
earlier parts in the line, such as below (60 columns wide, 65 character
filename):
```
rev], or leave (u)nresolved for some/long/dir/name/that/do
s/not/work/well/with/readline/file.txt?
```
With this fix, this looks like this on a 60 column screen:
```
tool vim_with_markers (for pattern some/long/dir/name/that/d
oes/not/work/well/with/readline/file.txt) can't handle binar
y
tool meld can't handle binary
tool vim_with_markers can't handle binary
tool internal:merge3 can't handle binary
tool merge can't handle binary
no tool found to merge some/long/dir/name/that/does/not/work
/well/with/readline/file.txt
file 'some/long/dir/name/that/does/not/work/well/with/readli
ne/file.txt' needs to be resolved.
You can keep (l)ocal [working copy], take (o)ther [merge rev
], or leave (u)nresolved.
What do you want to do?
```
Differential Revision: https://phab.mercurial-scm.org/D6562