Mercurial > hg
annotate tests/test-revert-interactive-curses.t @ 48247:c62e4397eb28
copy: recommend `--at-rev .` if target was added in parent commit
If the target file was added in the working copy parent, it's much
more likely that the user meant to use `--at-rev .` (to record the
copy/rename in the that commit) than `--force` (to replace the
just-added file by another file).
Differential Revision: https://phab.mercurial-scm.org/D11667
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 14 Oct 2021 10:58:39 -0700 |
parents | e5e6282fa66a |
children | 9a5d09d7f108 |
rev | line source |
---|---|
46325
e5e6282fa66a
hghave: split apart testing for the curses module and `tic` executable
Matt Harbison <matt_harbison@yahoo.com>
parents:
45153
diff
changeset
|
1 #require curses |
45153
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
2 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
3 Revert interactive tests with the Curses interface |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
4 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
5 $ cat <<EOF >> $HGRCPATH |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
6 > [ui] |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
7 > interactive = true |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
8 > interface = curses |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
9 > [experimental] |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
10 > crecordtest = testModeCommands |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
11 > EOF |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
12 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
13 TODO: Make a curses version of the other tests from test-revert-interactive.t. |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
14 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
15 When a line without EOL is selected during "revert -i" |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
16 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
17 $ hg init $TESTTMP/revert-i-curses-eol |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
18 $ cd $TESTTMP/revert-i-curses-eol |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
19 $ echo 0 > a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
20 $ hg ci -qAm 0 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
21 $ printf 1 >> a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
22 $ hg ci -qAm 1 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
23 $ cat a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
24 0 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
25 1 (no-eol) |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
26 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
27 $ cat <<EOF >testModeCommands |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
28 > c |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
29 > EOF |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
30 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
31 $ hg revert -ir'.^' |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
32 reverting a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
33 $ cat a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
34 0 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
35 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
36 When a selected line is reverted to have no EOL |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
37 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
38 $ hg init $TESTTMP/revert-i-curses-eol2 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
39 $ cd $TESTTMP/revert-i-curses-eol2 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
40 $ printf 0 > a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
41 $ hg ci -qAm 0 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
42 $ echo 0 > a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
43 $ hg ci -qAm 1 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
44 $ cat a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
45 0 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
46 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
47 $ cat <<EOF >testModeCommands |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
48 > c |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
49 > EOF |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
50 |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
51 $ hg revert -ir'.^' |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
52 reverting a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
53 $ cat a |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
54 0 (no-eol) |
8b6a446508c2
revert: fix interactive reverting of end-of-file newline changes
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff
changeset
|
55 |