tests/test-revert-interactive-curses.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 28 Sep 2021 18:29:57 +0200
changeset 48062 46d1b75648f4
parent 46325 e5e6282fa66a
child 49033 9a5d09d7f108
permissions -rw-r--r--
dirstate: drop unused condition in `from_p2` This conditional was added (by me) tentatively because "it seemed more correct", but it is not used anywhere yet, and it is missing from the C and the Rust implementation. So it seems more consistent to drop it for now. This effectively backout f94cc63df859c Differential Revision: https://phab.mercurial-scm.org/D11510

#require curses

Revert interactive tests with the Curses interface

  $ cat <<EOF >> $HGRCPATH
  > [ui]
  > interactive = true
  > interface = curses
  > [experimental]
  > crecordtest = testModeCommands
  > EOF

TODO: Make a curses version of the other tests from test-revert-interactive.t.

When a line without EOL is selected during "revert -i"

  $ hg init $TESTTMP/revert-i-curses-eol
  $ cd $TESTTMP/revert-i-curses-eol
  $ echo 0 > a
  $ hg ci -qAm 0
  $ printf 1 >> a
  $ hg ci -qAm 1
  $ cat a
  0
  1 (no-eol)

  $ cat <<EOF >testModeCommands
  > c
  > EOF

  $ hg revert -ir'.^'
  reverting a
  $ cat a
  0

When a selected line is reverted to have no EOL

  $ hg init $TESTTMP/revert-i-curses-eol2
  $ cd $TESTTMP/revert-i-curses-eol2
  $ printf 0 > a
  $ hg ci -qAm 0
  $ echo 0 > a
  $ hg ci -qAm 1
  $ cat a
  0

  $ cat <<EOF >testModeCommands
  > c
  > EOF

  $ hg revert -ir'.^'
  reverting a
  $ cat a
  0 (no-eol)