crecord: add test demonstrating issue when reverting noeol->eol change
Differential Revision: https://phab.mercurial-scm.org/D12440
--- a/tests/test-revert-interactive-curses.t Mon Mar 28 10:43:10 2022 -0700
+++ b/tests/test-revert-interactive-curses.t Tue Apr 05 11:09:57 2022 -0700
@@ -1,4 +1,5 @@
#require curses
+#testcases committed wdir
Revert interactive tests with the Curses interface
@@ -12,6 +13,22 @@
TODO: Make a curses version of the other tests from test-revert-interactive.t.
+#if committed
+ $ maybe_commit() {
+ > hg ci "$@"
+ > }
+ $ do_revert() {
+ > hg revert -ir'.^'
+ > }
+#else
+ $ maybe_commit() {
+ > true
+ > }
+ $ do_revert() {
+ > hg revert -i
+ > }
+#endif
+
When a line without EOL is selected during "revert -i"
$ hg init $TESTTMP/revert-i-curses-eol
@@ -19,7 +36,7 @@
$ echo 0 > a
$ hg ci -qAm 0
$ printf 1 >> a
- $ hg ci -qAm 1
+ $ maybe_commit -qAm 1
$ cat a
0
1 (no-eol)
@@ -28,7 +45,7 @@
> c
> EOF
- $ hg revert -ir'.^'
+ $ do_revert
reverting a
$ cat a
0
@@ -40,7 +57,7 @@
$ printf 0 > a
$ hg ci -qAm 0
$ echo 0 > a
- $ hg ci -qAm 1
+ $ maybe_commit -qAm 1
$ cat a
0
@@ -48,8 +65,9 @@
> c
> EOF
- $ hg revert -ir'.^'
+ $ do_revert
reverting a
$ cat a
+ 0 (wdir known-bad-output !)
0 (no-eol)