tests/test-revert-interactive-curses.t
author Simon Sapin <simon.sapin@octobus.net>
Fri, 10 Sep 2021 09:53:09 +0200
changeset 47955 e834b79def74
parent 46325 e5e6282fa66a
child 49033 9a5d09d7f108
permissions -rw-r--r--
rust: Switch to the memmap2-rs crate https://github.com/RazrFalcon/memmap2-rs This is a fork of the original memmap crate which appears to be unmaintained: https://github.com/danburkert/memmap-rs/issues/90 This fork is the most popular according to https://crates.io/keywords/mmap Differential Revision: https://phab.mercurial-scm.org/D11397
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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