tests/test-revert-interactive.t
author Valters Vingolds <valters@vingolds.ch>
Tue, 10 Jan 2017 09:32:27 +0100
changeset 30755 0fbb3a5c188e
parent 30532 66b162fa3ffa
child 31196 3af9a9628ecf
permissions -rw-r--r--
rebase: provide detailed hint to abort message if working dir is not clean Detailed hint message is now provided when 'pull --rebase' operation detects unclean working dir, for example: abort: uncommitted changes (cannot pull with rebase: please commit or shelve your changes first) Added tests for uncommitted merge, and for subrepo support verifying that same hint is also passed to subrepo state check.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     1
Revert interactive tests
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     2
1 add and commit file f
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     3
2 add commit file folder1/g
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     4
3 add and commit file folder2/h
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     5
4 add and commit file folder1/i
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     6
5 commit change to file f
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     7
6 commit changes to files folder1/g folder2/h
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     8
7 commit changes to files folder1/g folder2/h
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     9
8 revert interactive to commit id 2 (line 3 above), check that folder1/i is removed and
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    10
9 make workdir match 7
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    11
10 run the same test than 8 from within folder1 and check same expectations
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    12
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    13
  $ cat <<EOF >> $HGRCPATH
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    14
  > [ui]
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    15
  > interactive = true
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    16
  > [extensions]
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    17
  > record =
27985
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
    18
  > purge = 
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    19
  > EOF
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    20
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    21
24389
93d3e1a8bfb0 test-revert-interactive: eliminate bashism in wildcard pattern
Yuya Nishihara <yuya@tcha.org>
parents: 24361
diff changeset
    22
  $ mkdir -p a/folder1 a/folder2
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    23
  $ cd a
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    24
  $ hg init
24434
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    25
  >>> open('f', 'wb').write("1\n2\n3\n4\n5\n")
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    26
  $ hg add f ; hg commit -m "adding f"
24361
8de8cd34f2e3 tests: replace uses of 'seq' with portable 'seq.py'
Matt Harbison <matt_harbison@yahoo.com>
parents: 24359
diff changeset
    27
  $ cat f > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g"
8de8cd34f2e3 tests: replace uses of 'seq' with portable 'seq.py'
Matt Harbison <matt_harbison@yahoo.com>
parents: 24359
diff changeset
    28
  $ cat f > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h"
8de8cd34f2e3 tests: replace uses of 'seq' with portable 'seq.py'
Matt Harbison <matt_harbison@yahoo.com>
parents: 24359
diff changeset
    29
  $ cat f > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i"
24434
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    30
  >>> open('f', 'wb').write("a\n1\n2\n3\n4\n5\nb\n")
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    31
  $ hg commit -m "modifying f"
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    32
  >>> open('folder1/g', 'wb').write("c\n1\n2\n3\n4\n5\nd\n")
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    33
  $ hg commit -m "modifying folder1/g"
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    34
  >>> open('folder2/h', 'wb').write("e\n1\n2\n3\n4\n5\nf\n")
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24389
diff changeset
    35
  $ hg commit -m "modifying folder2/h"
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    36
  $ hg tip
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    37
  changeset:   6:59dd6e4ab63a
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    38
  tag:         tip
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    39
  user:        test
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    40
  date:        Thu Jan 01 00:00:00 1970 +0000
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    41
  summary:     modifying folder2/h
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    42
  
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    43
  $ hg revert -i -r 2 --all -- << EOF
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    44
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    45
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    46
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    47
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    48
  > y
30532
66b162fa3ffa revert: prompt before removing files in interactive mode
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30531
diff changeset
    49
  > y
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    50
  > n
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    51
  > n
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    52
  > EOF
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    53
  reverting f
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    54
  reverting folder1/g (glob)
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    55
  removing folder1/i (glob)
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    56
  reverting folder2/h (glob)
30532
66b162fa3ffa revert: prompt before removing files in interactive mode
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30531
diff changeset
    57
  remove added file folder1/i (Yn)? y
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
    58
  diff --git a/f b/f
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    59
  2 hunks, 2 lines changed
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    60
  examine changes to 'f'? [Ynesfdaq?] y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    61
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    62
  @@ -1,5 +1,6 @@
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    63
  +a
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    64
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    65
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    66
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    67
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    68
   5
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
    69
  revert change 1/6 to 'f'? [Ynesfdaq?] y
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    70
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    71
  @@ -1,5 +2,6 @@
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    72
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    73
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    74
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    75
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    76
   5
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    77
  +b
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
    78
  revert change 2/6 to 'f'? [Ynesfdaq?] y
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    79
  
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
    80
  diff --git a/folder1/g b/folder1/g
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    81
  2 hunks, 2 lines changed
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    82
  examine changes to 'folder1/g'? [Ynesfdaq?] y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    83
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    84
  @@ -1,5 +1,6 @@
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    85
  +c
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    86
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    87
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    88
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    89
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    90
   5
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
    91
  revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    92
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    93
  @@ -1,5 +2,6 @@
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    94
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    95
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    96
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    97
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    98
   5
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
    99
  +d
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   100
  revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   101
  
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
   102
  diff --git a/folder2/h b/folder2/h
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   103
  2 hunks, 2 lines changed
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   104
  examine changes to 'folder2/h'? [Ynesfdaq?] n
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   105
  
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   106
  $ cat f
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   107
  1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   108
  2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   109
  3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   110
  4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   111
  5
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   112
  $ cat folder1/g
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   113
  1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   114
  2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   115
  3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   116
  4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   117
  5
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   118
  d
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   119
  $ cat folder2/h
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   120
  e
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   121
  1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   122
  2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   123
  3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   124
  4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   125
  5
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   126
  f
24698
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   127
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   128
Test that --interactive lift the need for --all
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   129
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   130
  $ echo q | hg revert -i -r 2
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   131
  reverting folder1/g (glob)
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   132
  reverting folder2/h (glob)
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
   133
  diff --git a/folder1/g b/folder1/g
24698
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   134
  1 hunks, 1 lines changed
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   135
  examine changes to 'folder1/g'? [Ynesfdaq?] q
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   136
  
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   137
  abort: user quit
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   138
  [255]
29498
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   139
  $ ls folder1/
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   140
  g
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   141
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 29498
diff changeset
   142
Test that a noop revert doesn't do an unnecessary backup
29498
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   143
  $ (echo y; echo n) | hg revert -i -r 2 folder1/g
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   144
  diff --git a/folder1/g b/folder1/g
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   145
  1 hunks, 1 lines changed
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   146
  examine changes to 'folder1/g'? [Ynesfdaq?] y
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   147
  
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   148
  @@ -3,3 +3,4 @@
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   149
   3
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   150
   4
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   151
   5
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   152
  +d
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   153
  revert this change to 'folder1/g'? [Ynesfdaq?] n
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   154
  
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   155
  $ ls folder1/
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   156
  g
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   157
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   158
Test --no-backup
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   159
  $ (echo y; echo y) | hg revert -i -C -r 2 folder1/g
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   160
  diff --git a/folder1/g b/folder1/g
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   161
  1 hunks, 1 lines changed
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   162
  examine changes to 'folder1/g'? [Ynesfdaq?] y
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   163
  
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   164
  @@ -3,3 +3,4 @@
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   165
   3
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   166
   4
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   167
   5
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   168
  +d
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   169
  revert this change to 'folder1/g'? [Ynesfdaq?] y
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   170
  
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   171
  $ ls folder1/
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   172
  g
1b38cfde9530 revert: don't backup if no files reverted in interactive mode (issue4793)
skarlage <skarlage@fb.com>
parents: 29283
diff changeset
   173
  >>> open('folder1/g', 'wb').write("1\n2\n3\n4\n5\nd\n")
24698
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   174
a85c4ed1132f revert: do not requires '--all' if '--interative' is present
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24475
diff changeset
   175
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   176
  $ hg update -C 6
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   177
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   178
  $ hg revert -i -r 2 --all -- << EOF
30532
66b162fa3ffa revert: prompt before removing files in interactive mode
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30531
diff changeset
   179
  > n
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   180
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   181
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   182
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   183
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   184
  > y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   185
  > n
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   186
  > n
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   187
  > EOF
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   188
  reverting f
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   189
  reverting folder1/g (glob)
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   190
  removing folder1/i (glob)
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   191
  reverting folder2/h (glob)
30532
66b162fa3ffa revert: prompt before removing files in interactive mode
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30531
diff changeset
   192
  remove added file folder1/i (Yn)? n
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
   193
  diff --git a/f b/f
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   194
  2 hunks, 2 lines changed
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   195
  examine changes to 'f'? [Ynesfdaq?] y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   196
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   197
  @@ -1,5 +1,6 @@
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   198
  +a
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   199
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   200
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   201
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   202
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   203
   5
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   204
  revert change 1/6 to 'f'? [Ynesfdaq?] y
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   205
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   206
  @@ -1,5 +2,6 @@
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   207
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   208
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   209
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   210
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   211
   5
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   212
  +b
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   213
  revert change 2/6 to 'f'? [Ynesfdaq?] y
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   214
  
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
   215
  diff --git a/folder1/g b/folder1/g
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   216
  2 hunks, 2 lines changed
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   217
  examine changes to 'folder1/g'? [Ynesfdaq?] y
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   218
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   219
  @@ -1,5 +1,6 @@
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   220
  +c
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   221
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   222
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   223
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   224
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   225
   5
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   226
  revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   227
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   228
  @@ -1,5 +2,6 @@
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   229
   1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   230
   2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   231
   3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   232
   4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   233
   5
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   234
  +d
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   235
  revert change 4/6 to 'folder1/g'? [Ynesfdaq?] n
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   236
  
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
   237
  diff --git a/folder2/h b/folder2/h
24359
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   238
  2 hunks, 2 lines changed
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   239
  examine changes to 'folder2/h'? [Ynesfdaq?] n
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   240
  
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   241
  $ cat f
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   242
  1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   243
  2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   244
  3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   245
  4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   246
  5
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   247
  $ cat folder1/g
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   248
  1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   249
  2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   250
  3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   251
  4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   252
  5
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   253
  d
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   254
  $ cat folder2/h
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   255
  e
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   256
  1
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   257
  2
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   258
  3
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   259
  4
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   260
  5
521fe8287dd5 revert: add flag to make revert interactive
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   261
  f
24475
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   262
  $ hg st
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   263
  M f
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   264
  M folder1/g
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   265
  $ hg revert --interactive f << EOF
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   266
  > y
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   267
  > y
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   268
  > n
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   269
  > n
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   270
  > EOF
25258
f37a69ec3f47 revert: make revert --interactive use git style diff
Laurent Charignon <lcharignon@fb.com>
parents: 24698
diff changeset
   271
  diff --git a/f b/f
24475
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   272
  2 hunks, 2 lines changed
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   273
  examine changes to 'f'? [Ynesfdaq?] y
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   274
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   275
  @@ -1,6 +1,5 @@
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   276
  -a
24475
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   277
   1
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   278
   2
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   279
   3
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   280
   4
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   281
   5
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   282
  discard change 1/2 to 'f'? [Ynesfdaq?] y
24475
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   283
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   284
  @@ -2,6 +1,5 @@
24475
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   285
   1
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   286
   2
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   287
   3
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   288
   4
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   289
   5
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   290
  -b
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   291
  discard change 2/2 to 'f'? [Ynesfdaq?] n
24475
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   292
  
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   293
  $ hg st
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   294
  M f
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   295
  M folder1/g
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   296
  ? f.orig
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   297
  $ cat f
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   298
  a
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   299
  1
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   300
  2
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   301
  3
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   302
  4
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   303
  5
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   304
  $ cat f.orig
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   305
  1
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   306
  2
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   307
  3
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   308
  4
06cbff4674a3 revert: fix --interactive on local modification (issue4576)
Laurent Charignon <lcharignon@fb.com>
parents: 24434
diff changeset
   309
  5
25259
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   310
  $ rm f.orig
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   311
  $ hg update -C .
30532
66b162fa3ffa revert: prompt before removing files in interactive mode
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30531
diff changeset
   312
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
25259
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   313
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   314
Check editing files newly added by a revert
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   315
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   316
1) Create a dummy editor changing 1 to 42
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   317
  $ cat > $TESTTMP/editor.sh << '__EOF__'
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   318
  > cat "$1"  | sed "s/1/42/g"  > tt
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   319
  > mv tt  "$1"
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   320
  > __EOF__
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   321
25656
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   322
2) Add k
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   323
  $ printf "1\n" > k
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   324
  $ hg add k
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   325
  $ hg commit -m "add k"
25259
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   326
25656
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   327
3) Use interactive revert with editing (replacing +1 with +42):
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   328
  $ printf "0\n2\n" > k
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   329
  $ HGEDITOR="\"sh\" \"${TESTTMP}/editor.sh\"" hg revert -i  <<EOF
25259
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   330
  > y
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   331
  > e
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   332
  > EOF
25656
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   333
  reverting k
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   334
  diff --git a/k b/k
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   335
  1 hunks, 2 lines changed
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   336
  examine changes to 'k'? [Ynesfdaq?] y
25259
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   337
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   338
  @@ -1,1 +1,2 @@
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   339
  -1
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   340
  +0
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   341
  +2
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   342
  discard this change to 'k'? [Ynesfdaq?] e
25259
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   343
  
25656
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   344
  $ cat k
25259
5b05f10c5024 revert: fix edition of newly added file during --interactive
Laurent Charignon <lcharignon@fb.com>
parents: 25258
diff changeset
   345
  42
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   346
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   347
Check the experimental config to invert the selection:
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   348
  $ cat <<EOF >> $HGRCPATH
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   349
  > [experimental]
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   350
  > revertalternateinteractivemode=False
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   351
  > EOF
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   352
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   353
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   354
  $ hg up -C .
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   355
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   356
  $ printf 'firstline\nc\n1\n2\n3\n 3\n5\nd\nlastline\n' > folder1/g
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   357
  $ hg diff --nodates
25656
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   358
  diff -r a3d963a027aa folder1/g
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   359
  --- a/folder1/g
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   360
  +++ b/folder1/g
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   361
  @@ -1,7 +1,9 @@
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   362
  +firstline
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   363
   c
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   364
   1
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   365
   2
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   366
   3
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   367
  -4
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   368
  + 3
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   369
   5
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   370
   d
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   371
  +lastline
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   372
  $ hg revert -i <<EOF
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   373
  > y
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   374
  > y
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   375
  > y
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   376
  > n
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   377
  > EOF
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   378
  reverting folder1/g (glob)
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   379
  diff --git a/folder1/g b/folder1/g
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   380
  3 hunks, 3 lines changed
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   381
  examine changes to 'folder1/g'? [Ynesfdaq?] y
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   382
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   383
  @@ -1,5 +1,4 @@
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   384
  -firstline
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   385
   c
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   386
   1
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   387
   2
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   388
   3
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   389
  discard change 1/3 to 'folder1/g'? [Ynesfdaq?] y
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   390
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   391
  @@ -2,7 +1,7 @@
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   392
   c
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   393
   1
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   394
   2
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   395
   3
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   396
  - 3
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   397
  +4
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   398
   5
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   399
   d
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   400
  discard change 2/3 to 'folder1/g'? [Ynesfdaq?] y
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   401
  
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   402
  @@ -7,3 +6,2 @@
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   403
   5
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   404
   d
25657
dcc56e10c23b revert: change the direction of revert -i
Laurent Charignon <lcharignon@fb.com>
parents: 25656
diff changeset
   405
  -lastline
29283
14eee72c8d52 revert: use "discard"/"revert" verb when reverting interactively (issue5143)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 27985
diff changeset
   406
  discard change 3/3 to 'folder1/g'? [Ynesfdaq?] n
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   407
  
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   408
  $ hg diff --nodates
25656
88d244f4edfd revert: change a test to make the change of direction of revert -i easier
Laurent Charignon <lcharignon@fb.com>
parents: 25424
diff changeset
   409
  diff -r a3d963a027aa folder1/g
25424
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   410
  --- a/folder1/g
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   411
  +++ b/folder1/g
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   412
  @@ -5,3 +5,4 @@
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   413
   4
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   414
   5
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   415
   d
69609f43c752 revert: add an experimental config to use inverted selection
Laurent Charignon <lcharignon@fb.com>
parents: 25350
diff changeset
   416
  +lastline
27985
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   417
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   418
  $ hg update -C .
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   419
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   420
  $ hg purge
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   421
  $ touch newfile
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   422
  $ hg add newfile
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   423
  $ hg status
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   424
  A newfile
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   425
  $ hg revert -i <<EOF
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   426
  > n
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   427
  > EOF
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   428
  forgetting newfile
30531
841092fd6b85 revert: indicate the default choice when prompting to forget files
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30332
diff changeset
   429
  forget added file newfile (Yn)? n
27985
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   430
  $ hg status
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   431
  A newfile
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   432
  $ hg revert -i <<EOF
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   433
  > y
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   434
  > EOF
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   435
  forgetting newfile
30531
841092fd6b85 revert: indicate the default choice when prompting to forget files
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30332
diff changeset
   436
  forget added file newfile (Yn)? y
27985
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   437
  $ hg status
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   438
  ? newfile
79139c7a88bd revert: makes interactive mode ask to forget added files (issue4936)
liscju <piotr.listkiewicz@gmail.com>
parents: 25657
diff changeset
   439