tests/test-revert.t
author Simon Sapin <simon.sapin@octobus.net>
Fri, 17 Dec 2021 17:56:13 +0100
changeset 48512 262a38f10427
parent 48384 9f1b9e128788
child 48876 42d2b31cee0b
permissions -rw-r--r--
rhg: Accept different "invalid ignore pattern" error message formatting At the moment rhg compiles all patterns into a single big regular expression, so it’s not practical to find out which file the invalid bit of syntax came from. Differential Revision: https://phab.mercurial-scm.org/D11942
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
     1
  $ hg init repo
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
     2
  $ cd repo
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
     3
  $ echo 123 > a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
     4
  $ echo 123 > c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
     5
  $ echo 123 > e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
     6
  $ hg add a c e
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
     7
  $ hg commit -m "first" a c e
14745
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
     8
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
     9
nothing changed
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
    10
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
    11
  $ hg revert
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
    12
  abort: no files or directories specified
14755
6ba51c81ff75 revert: improve hints on abort when reverting to parent without --all
Adrian Buehlmann <adrian@cadifra.com>
parents: 14745
diff changeset
    13
  (use --all to revert all files)
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44724
diff changeset
    14
  [10]
14767
aab323df2c44 test-revert: add revert --all case when nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14755
diff changeset
    15
  $ hg revert --all
14745
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
    16
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    17
Introduce some changes and revert them
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    18
--------------------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    19
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    20
  $ echo 123 > b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    21
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    22
  $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    23
  ? b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    24
  $ echo 12 > c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    25
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    26
  $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    27
  M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    28
  ? b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    29
  $ hg add b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    30
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    31
  $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    32
  M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    33
  A b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    34
  $ hg rm a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    35
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    36
  $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    37
  M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    38
  A b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    39
  R a
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    40
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    41
revert removal of a file
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    42
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    43
  $ hg revert a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    44
  $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    45
  M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    46
  A b
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    47
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    48
revert addition of a file
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    49
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    50
  $ hg revert b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    51
  $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    52
  M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    53
  ? b
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    54
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    55
revert modification of a file (--no-backup)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    56
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    57
  $ hg revert --no-backup c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    58
  $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    59
  ? b
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    60
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    61
revert deletion (! status) of a added file
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    62
------------------------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    63
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    64
  $ hg add b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    65
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    66
  $ hg status b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    67
  A b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    68
  $ rm b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    69
  $ hg status b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    70
  ! b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    71
  $ hg revert -v b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    72
  forgetting b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    73
  $ hg status b
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 15447
diff changeset
    74
  b: * (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    75
44724
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 41605
diff changeset
    76
  $ ls -A
5c2a4f37eace tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems
Joerg Sonnenberger <joerg@bec.de>
parents: 41605
diff changeset
    77
  .hg
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    78
  a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    79
  c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    80
  e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    81
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    82
Test creation of backup (.orig) files
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    83
-------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    84
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    85
  $ echo z > e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    86
  $ hg revert --all -v
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    87
  saving current version of e as e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    88
  reverting e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    89
26938
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    90
Test creation of backup (.orig) file in configured file location
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    91
----------------------------------------------------------------
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    92
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    93
  $ echo z > e
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    94
  $ hg revert --all -v --config 'ui.origbackuppath=.hg/origbackups'
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
    95
  creating directory: $TESTTMP/repo/.hg/origbackups
41591
4d4842445afc revert: always show relative path to .orig backup
Martin von Zweigbergk <martinvonz@google.com>
parents: 39740
diff changeset
    96
  saving current version of e as .hg/origbackups/e
26938
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    97
  reverting e
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    98
  $ rm -rf .hg/origbackups
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
    99
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   100
revert on clean file (no change)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   101
--------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   102
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   103
  $ hg revert a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   104
  no changes needed to a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   105
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   106
revert on an untracked file
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   107
---------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   108
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   109
  $ echo q > q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   110
  $ hg revert q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   111
  file not managed: q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   112
  $ rm q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   113
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   114
revert on file that does not exists
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   115
-----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   116
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   117
  $ hg revert notfound
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   118
  notfound: no such file in rev 334a9e57682c
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   119
  $ touch d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   120
  $ hg add d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   121
  $ hg rm a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   122
  $ hg commit -m "second"
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   123
  $ echo z > z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   124
  $ hg add z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   125
  $ hg st
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   126
  A z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   127
  ? e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   128
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   129
revert to another revision (--rev)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   130
----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   131
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   132
  $ hg revert --all -r0
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   133
  forgetting z
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   134
  removing d
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   135
  adding a
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   136
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   137
revert explicitly to parent (--rev)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   138
-----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   139
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   140
  $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   141
  forgetting a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   142
  undeleting d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   143
  $ rm a *.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   144
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   145
revert to another revision (--rev) and exact match
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   146
--------------------------------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   147
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   148
exact match are more silent
1447
508a3f559553 revert added and removed files to their normal state before reverting
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
   149
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   150
  $ hg revert -r0 a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   151
  $ hg st a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   152
  A a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   153
  $ hg rm d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   154
  $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   155
  R d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   156
22156
03a45eff9d2b revert: issue "no changes needed" message for files missing on both side
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22144
diff changeset
   157
should keep d removed
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   158
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   159
  $ hg revert -r0 d
22156
03a45eff9d2b revert: issue "no changes needed" message for files missing on both side
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22144
diff changeset
   160
  no changes needed to d
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   161
  $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   162
  R d
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
   163
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   164
  $ hg update -C
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   165
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   166
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   167
revert of exec bit
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   168
------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   169
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
   170
#if execbit
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   171
  $ chmod +x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   172
  $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   173
  reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   174
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   175
  $ test -x c || echo non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   176
  non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   177
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   178
  $ chmod +x c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   179
  $ hg commit -m exe
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
   180
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   181
  $ chmod -x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   182
  $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   183
  reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   184
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   185
  $ test -x c && echo executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   186
  executable
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
   187
#endif
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   188
25753
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   189
Test that files reverted to other than the parent are treated as
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   190
"modified", even if none of mode, size and timestamp of it isn't
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   191
changed on the filesystem (see also issue4583).
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   192
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   193
  $ echo 321 > e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   194
  $ hg diff --git
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   195
  diff --git a/e b/e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   196
  --- a/e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   197
  +++ b/e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   198
  @@ -1,1 +1,1 @@
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   199
  -123
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   200
  +321
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   201
  $ hg commit -m 'ambiguity from size'
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   202
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   203
  $ cat e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   204
  321
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   205
  $ touch -t 200001010000 e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   206
  $ hg debugrebuildstate
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   207
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   208
  $ cat >> .hg/hgrc <<EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   209
  > [fakedirstatewritetime]
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   210
  > # emulate invoking dirstate.write() via repo.status()
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   211
  > # at 2000-01-01 00:00
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   212
  > fakenow = 200001010000
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   213
  > 
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   214
  > [extensions]
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   215
  > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   216
  > EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   217
  $ hg revert -r 0 e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   218
  $ cat >> .hg/hgrc <<EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   219
  > [extensions]
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   220
  > fakedirstatewritetime = !
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   221
  > EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   222
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   223
  $ cat e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   224
  123
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   225
  $ touch -t 200001010000 e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   226
  $ hg status -A e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   227
  M e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
   228
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   229
  $ cd ..
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   230
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   231
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
   232
Issue241: update and revert produces inconsistent repositories
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   233
--------------------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
   234
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   235
  $ hg init a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   236
  $ cd a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   237
  $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   238
  $ hg commit -A -d '1 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   239
  adding a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   240
  $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   241
  $ hg commit -d '2 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   242
  $ hg update 0
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   243
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   244
  $ mkdir b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   245
  $ echo b > b/b
2272
e9a0ed9ed4d9 revert: fix corner case found by faheem mitha.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2157
diff changeset
   246
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   247
call `hg revert` with no file specified
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   248
---------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   249
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   250
  $ hg revert -rtip
14542
afe0d4c24866 revert: drop requirement to use -r to revert with two parents
Matt Mackall <mpm@selenic.com>
parents: 12399
diff changeset
   251
  abort: no files or directories specified
14726
e0039716f3ea revert: mention update in hint of abort when reverting to non-parent
Adrian Buehlmann <adrian@cadifra.com>
parents: 14713
diff changeset
   252
  (use --all to revert all files, or 'hg update 1' to update)
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 44724
diff changeset
   253
  [10]
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   254
24841
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   255
call `hg revert` with -I
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   256
---------------------------
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   257
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   258
  $ echo a >> a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   259
  $ hg revert -I a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   260
  reverting a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   261
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   262
call `hg revert` with -X
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   263
---------------------------
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   264
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   265
  $ echo a >> a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   266
  $ hg revert -X d
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   267
  reverting a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   268
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   269
call `hg revert` with --all
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   270
---------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   271
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   272
  $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   273
  reverting a
24841
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
   274
  $ rm *.orig
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   275
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
   276
Issue332: confusing message when reverting directory
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   277
----------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
   278
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   279
  $ hg ci -A -m b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   280
  adding b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   281
  created new head
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   282
  $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   283
  $ mkdir newdir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   284
  $ echo foo > newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   285
  $ hg add newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   286
  $ hg revert b newdir
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   287
  forgetting newdir/newfile
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
   288
  reverting b/b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   289
  $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   290
  $ hg revert .
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
   291
  reverting b/b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   292
41605
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   293
respects ui.relative-paths
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   294
--------------------------
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   295
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   296
  $ echo foo > newdir/newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   297
  $ hg add newdir/newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   298
  $ hg revert --all --cwd newdir
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   299
  forgetting newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   300
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   301
  $ echo foo > newdir/newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   302
  $ hg add newdir/newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   303
  $ hg revert --all --cwd newdir --config ui.relative-paths=True
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   304
  forgetting newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   305
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   306
  $ echo foo > newdir/newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   307
  $ hg add newdir/newfile
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   308
  $ hg revert --all --cwd newdir --config ui.relative-paths=False
7068c6b0114b revert: respect ui.relative-paths
Martin von Zweigbergk <martinvonz@google.com>
parents: 41591
diff changeset
   309
  forgetting newdir/newfile
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
   310
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   311
reverting a rename target should revert the source
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   312
--------------------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   313
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   314
  $ hg mv a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   315
  $ hg revert newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   316
  $ hg st a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   317
  ? newa
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
   318
23403
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
   319
Also true for move overwriting an existing file
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
   320
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
   321
  $ hg mv --force a b/b
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
   322
  $ hg revert b/b
48384
9f1b9e128788 dirstate: do no use `set_clean` in revert
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45827
diff changeset
   323
  $ hg status a b/b --copies
23403
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
   324
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   325
  $ cd ..
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
   326
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   327
  $ hg init ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   328
  $ cd ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   329
  $ echo '^ignored$' > .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   330
  $ echo '^ignoreddir$' >> .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   331
  $ echo '^removed$' >> .hgignore
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
   332
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   333
  $ mkdir ignoreddir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   334
  $ touch ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   335
  $ touch ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   336
  $ touch ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   337
  $ touch removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   338
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   339
4 ignored files (we will add/commit everything)
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   340
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   341
  $ hg st -A -X .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   342
  I ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   343
  I ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   344
  I ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   345
  I removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   346
  $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
   347
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   348
  $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   349
  $ echo >> ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   350
  $ hg rm removed ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   351
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   352
should revert ignored* and undelete *removed
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   353
--------------------------------------------
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
   354
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   355
  $ hg revert -a --no-backup
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   356
  reverting ignored
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
   357
  reverting ignoreddir/file
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
   358
  undeleting ignoreddir/removed
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   359
  undeleting removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   360
  $ hg st -mardi
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   361
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   362
  $ hg up -qC
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   363
  $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   364
  $ hg rm removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   365
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   366
should silently revert the named files
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   367
--------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   368
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   369
  $ hg revert --no-backup ignored removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   370
  $ hg st -mardi
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16886
diff changeset
   371
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   372
Reverting copy (issue3920)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   373
--------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   374
19129
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   375
someone set up us the copies
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   376
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   377
  $ rm .hgignore
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   378
  $ hg update -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   379
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   380
  $ hg mv ignored allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   381
  $ hg copy removed base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   382
  $ hg commit -m rename
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   383
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   384
copies and renames, you have no chance to survive make your time (issue3920)
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   385
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   386
  $ hg update '.^'
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   387
  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   388
  $ hg revert -rtip -a
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   389
  removing ignored
19129
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   390
  adding allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   391
  adding base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   392
  $ hg status -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   393
  A allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   394
    ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   395
  A base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   396
    removed
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   397
  R ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   398
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   399
Test revert of a file added by one side of the merge
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   400
====================================================
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   401
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   402
remove any pending change
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   403
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   404
  $ hg revert --all
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   405
  forgetting allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   406
  forgetting base
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   407
  undeleting ignored
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   408
  $ hg purge --all --config extensions.purge=
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   409
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   410
Adds a new commit
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   411
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   412
  $ echo foo > newadd
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   413
  $ hg add newadd
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   414
  $ hg commit -m 'other adds'
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   415
  created new head
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   416
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   417
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   418
merge it with the other head
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   419
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   420
  $ hg merge # merge 1 into 2
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   421
  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   422
  (branch merge, don't forget to commit)
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   423
  $ hg summary
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   424
  parent: 2:b8ec310b2d4e tip
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   425
   other adds
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   426
  parent: 1:f6180deb8fbe 
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   427
   rename
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   428
  branch: default
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   429
  commit: 2 modified, 1 removed (merge)
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   430
  update: (current)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25111
diff changeset
   431
  phases: 3 draft
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   432
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   433
clarifies who added what
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   434
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   435
  $ hg status
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   436
  M allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   437
  M base
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   438
  R ignored
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   439
  $ hg status --change 'p1()'
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   440
  A newadd
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   441
  $ hg status --change 'p2()'
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   442
  A allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   443
  A base
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   444
  R ignored
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   445
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   446
revert file added by p1() to p1() state
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   447
-----------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   448
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   449
  $ hg revert -r 'p1()' 'glob:newad?'
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   450
  $ hg status
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   451
  M allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   452
  M base
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   453
  R ignored
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   454
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   455
revert file added by p1() to p2() state
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   456
------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   457
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   458
  $ hg revert -r 'p2()' 'glob:newad?'
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   459
  removing newadd
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   460
  $ hg status
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   461
  M allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   462
  M base
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   463
  R ignored
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   464
  R newadd
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   465
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   466
revert file added by p2() to p2() state
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   467
------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   468
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   469
  $ hg revert -r 'p2()' 'glob:allyou?'
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   470
  $ hg status
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   471
  M allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   472
  M base
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   473
  R ignored
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   474
  R newadd
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   475
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   476
revert file added by p2() to p1() state
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   477
------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   478
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   479
  $ hg revert -r 'p1()' 'glob:allyou?'
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   480
  removing allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   481
  $ hg status
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   482
  M base
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   483
  R allyour
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   484
  R ignored
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   485
  R newadd
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   486
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   487
Systematic behavior validation of most possible cases
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   488
=====================================================
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   489
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   490
This section tests most of the possible combinations of revision states and
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   491
working directory states. The number of possible cases is significant but they
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
   492
but they all have a slightly different handling. So this section commits to
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   493
and testing all of them to allow safe refactoring of the revert code.
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   494
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   495
A python script is used to generate a file history for each combination of
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   496
states, on one side the content (or lack thereof) in two revisions, and
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   497
on the other side, the content and "tracked-ness" of the working directory. The
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   498
three states generated are:
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   499
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   500
- a "base" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   501
- a "parent" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   502
- the working directory (based on "parent")
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   503
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   504
The files generated have names of the form:
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   505
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   506
 <rev1-content>_<rev2-content>_<working-copy-content>-<tracked-ness>
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   507
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   508
All known states are not tested yet. See inline documentation for details.
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   509
Special cases from merge and rename are not tested by this section.
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   510
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   511
Write the python script to disk
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   512
-------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   513
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   514
check list of planned files
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   515
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   516
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 2
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   517
  content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   518
  content1_content1_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   519
  content1_content1_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   520
  content1_content1_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   521
  content1_content1_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   522
  content1_content1_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   523
  content1_content2_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   524
  content1_content2_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   525
  content1_content2_content2-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   526
  content1_content2_content2-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   527
  content1_content2_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   528
  content1_content2_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   529
  content1_content2_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   530
  content1_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   531
  content1_missing_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   532
  content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   533
  content1_missing_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   534
  content1_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   535
  content1_missing_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   536
  content1_missing_missing-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   537
  missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   538
  missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   539
  missing_content2_content3-tracked
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   540
  missing_content2_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   541
  missing_content2_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   542
  missing_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   543
  missing_missing_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   544
  missing_missing_content3-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   545
  missing_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   546
  missing_missing_missing-untracked
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   547
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   548
Script to make a simple text version of the content
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   549
---------------------------------------------------
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   550
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   551
  $ cat << EOF >> dircontent.py
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   552
  > # generate a simple text view of the directory for easy comparison
39740
e0a7cfa9323f py3: use print as a function in tests/test-revert.t
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39707
diff changeset
   553
  > from __future__ import print_function
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   554
  > import os
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   555
  > files = os.listdir('.')
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   556
  > files.sort()
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   557
  > for filename in files:
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   558
  >     if os.path.isdir(filename):
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   559
  >         continue
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   560
  >     content = open(filename).read()
39740
e0a7cfa9323f py3: use print as a function in tests/test-revert.t
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39707
diff changeset
   561
  >     print('%-6s %s' % (content.strip(), filename))
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   562
  > EOF
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   563
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   564
Generate appropriate repo state
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   565
-------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   566
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   567
  $ hg init revert-ref
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   568
  $ cd revert-ref
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   569
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   570
Generate base changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   571
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   572
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 1
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   573
  $ hg addremove --similarity 0
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   574
  adding content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   575
  adding content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   576
  adding content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   577
  adding content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   578
  adding content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   579
  adding content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   580
  adding content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   581
  adding content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   582
  adding content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   583
  adding content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   584
  adding content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   585
  adding content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   586
  adding content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   587
  adding content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   588
  adding content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   589
  adding content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   590
  adding content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   591
  adding content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   592
  adding content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   593
  adding content1_missing_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   594
  $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   595
  A content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   596
  A content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   597
  A content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   598
  A content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   599
  A content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   600
  A content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   601
  A content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   602
  A content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   603
  A content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   604
  A content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   605
  A content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   606
  A content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   607
  A content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   608
  A content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   609
  A content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   610
  A content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   611
  A content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   612
  A content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   613
  A content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   614
  A content1_missing_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   615
  $ hg commit -m 'base'
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   616
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   617
(create a simple text version of the content)
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   618
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   619
  $ "$PYTHON" ../dircontent.py > ../content-base.txt
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   620
  $ cat ../content-base.txt
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   621
  content1 content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   622
  content1 content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   623
  content1 content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   624
  content1 content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   625
  content1 content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   626
  content1 content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   627
  content1 content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   628
  content1 content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   629
  content1 content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   630
  content1 content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   631
  content1 content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   632
  content1 content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   633
  content1 content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   634
  content1 content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   635
  content1 content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   636
  content1 content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   637
  content1 content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   638
  content1 content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   639
  content1 content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   640
  content1 content1_missing_missing-untracked
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   641
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   642
Create parent changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   643
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   644
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 2
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   645
  $ hg addremove --similarity 0
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   646
  removing content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   647
  removing content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   648
  removing content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   649
  removing content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   650
  removing content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   651
  removing content1_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   652
  adding missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   653
  adding missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   654
  adding missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   655
  adding missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   656
  adding missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   657
  adding missing_content2_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   658
  $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   659
  M content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   660
  M content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   661
  M content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   662
  M content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   663
  M content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   664
  M content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   665
  M content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   666
  M content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   667
  A missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   668
  A missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   669
  A missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   670
  A missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   671
  A missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   672
  A missing_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   673
  R content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   674
  R content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   675
  R content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   676
  R content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   677
  R content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   678
  R content1_missing_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   679
  $ hg commit -m 'parent'
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   680
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   681
(create a simple text version of the content)
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   682
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   683
  $ "$PYTHON" ../dircontent.py > ../content-parent.txt
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   684
  $ cat ../content-parent.txt
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   685
  content1 content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   686
  content1 content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   687
  content1 content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   688
  content1 content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   689
  content1 content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   690
  content1 content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   691
  content2 content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   692
  content2 content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   693
  content2 content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   694
  content2 content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   695
  content2 content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   696
  content2 content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   697
  content2 content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   698
  content2 content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   699
  content2 missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   700
  content2 missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   701
  content2 missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   702
  content2 missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   703
  content2 missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   704
  content2 missing_content2_missing-untracked
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   705
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   706
Setup working directory
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   707
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   708
  $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   709
  $ hg addremove --similarity 0
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   710
  adding content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   711
  adding content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   712
  adding content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   713
  adding content1_missing_content3-untracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   714
  adding content1_missing_missing-tracked
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   715
  adding content1_missing_missing-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   716
  adding missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   717
  adding missing_missing_content3-untracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   718
  adding missing_missing_missing-tracked
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   719
  adding missing_missing_missing-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   720
  $ hg forget *_*_*-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   721
  $ rm *_*_missing-*
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   722
  $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   723
  M content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   724
  M content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   725
  M content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   726
  M missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   727
  A content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   728
  A content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   729
  A missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   730
  R content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   731
  R content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   732
  R content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   733
  R content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   734
  R content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   735
  R content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   736
  R content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   737
  R missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   738
  R missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   739
  R missing_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   740
  ! content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   741
  ! content1_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   742
  ! content1_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   743
  ! missing_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   744
  ! missing_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   745
  ? content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   746
  ? content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   747
  ? missing_missing_content3-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   748
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   749
  $ hg status --rev 'desc("base")'
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   750
  M content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   751
  M content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   752
  M content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   753
  M content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   754
  A missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   755
  A missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   756
  A missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   757
  R content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   758
  R content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   759
  R content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   760
  R content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   761
  R content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   762
  R content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   763
  R content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   764
  R content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   765
  R content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   766
  R content1_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   767
  ! content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   768
  ! content1_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   769
  ! content1_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   770
  ! missing_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   771
  ! missing_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   772
  ? missing_missing_content3-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   773
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   774
(create a simple text version of the content)
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   775
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   776
  $ "$PYTHON" ../dircontent.py > ../content-wc.txt
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   777
  $ cat ../content-wc.txt
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   778
  content1 content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   779
  content1 content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   780
  content3 content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   781
  content3 content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   782
  content1 content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   783
  content1 content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   784
  content2 content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   785
  content2 content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   786
  content3 content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   787
  content3 content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   788
  content1 content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   789
  content1 content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   790
  content3 content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   791
  content3 content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   792
  content2 missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   793
  content2 missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   794
  content3 missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   795
  content3 missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   796
  content3 missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   797
  content3 missing_missing_content3-untracked
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   798
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   799
  $ cd ..
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   800
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   801
Test revert --all to parent content
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   802
-----------------------------------
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   803
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   804
(setup from reference repo)
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   805
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
   806
  $ cp -R revert-ref revert-parent-all
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   807
  $ cd revert-parent-all
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   808
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   809
check revert output
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   810
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   811
  $ hg revert --all
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   812
  forgetting content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   813
  forgetting content1_missing_content3-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   814
  forgetting content1_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   815
  forgetting missing_missing_content3-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
   816
  forgetting missing_missing_missing-tracked
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   817
  reverting content1_content1_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   818
  reverting content1_content1_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   819
  reverting content1_content2_content1-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   820
  reverting content1_content2_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   821
  reverting content1_content2_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   822
  reverting missing_content2_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   823
  reverting missing_content2_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   824
  undeleting content1_content1_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   825
  undeleting content1_content1_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   826
  undeleting content1_content1_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   827
  undeleting content1_content2_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   828
  undeleting content1_content2_content2-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   829
  undeleting content1_content2_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   830
  undeleting content1_content2_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   831
  undeleting missing_content2_content2-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   832
  undeleting missing_content2_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   833
  undeleting missing_content2_missing-untracked
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   834
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   835
Compare resulting directory with revert target.
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   836
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   837
The diff is filtered to include change only. The only difference should be
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   838
additional `.orig` backup file when applicable.
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   839
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   840
  $ "$PYTHON" ../dircontent.py > ../content-parent-all.txt
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   841
  $ cd ..
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   842
  $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   843
  +content3 content1_content1_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   844
  +content3 content1_content1_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   845
  +content1 content1_content2_content1-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   846
  +content1 content1_content2_content1-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   847
  +content3 content1_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   848
  +content3 content1_content2_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   849
  +content1 content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   850
  +content1 content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   851
  +content3 content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   852
  +content3 content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   853
  +content3 missing_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   854
  +content3 missing_content2_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   855
  +content3 missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   856
  +content3 missing_missing_content3-untracked
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   857
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   858
Test revert --all to "base" content
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   859
-----------------------------------
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   860
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   861
(setup from reference repo)
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   862
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
   863
  $ cp -R revert-ref revert-base-all
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   864
  $ cd revert-base-all
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   865
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   866
check revert output
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   867
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   868
  $ hg revert --all --rev 'desc(base)'
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   869
  forgetting missing_missing_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   870
  forgetting missing_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   871
  removing missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   872
  removing missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   873
  removing missing_content2_missing-tracked
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   874
  reverting content1_content1_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   875
  reverting content1_content1_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   876
  reverting content1_content2_content2-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   877
  reverting content1_content2_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   878
  reverting content1_content2_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   879
  reverting content1_missing_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   880
  reverting content1_missing_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   881
  adding content1_missing_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   882
  adding content1_missing_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   883
  adding content1_missing_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   884
  undeleting content1_content1_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   885
  undeleting content1_content1_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   886
  undeleting content1_content1_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   887
  undeleting content1_content2_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   888
  undeleting content1_content2_content2-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   889
  undeleting content1_content2_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
   890
  undeleting content1_content2_missing-untracked
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   891
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   892
Compare resulting directory with revert target.
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   893
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   894
The diff is filtered to include change only. The only difference should be
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   895
additional `.orig` backup file when applicable.
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   896
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   897
  $ "$PYTHON" ../dircontent.py > ../content-base-all.txt
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   898
  $ cd ..
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   899
  $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   900
  +content3 content1_content1_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   901
  +content3 content1_content1_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   902
  +content2 content1_content2_content2-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   903
  +content3 content1_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   904
  +content3 content1_content2_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   905
  +content3 content1_missing_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   906
  +content3 content1_missing_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   907
  +content2 missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   908
  +content3 missing_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   909
  +content3 missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   910
  +content3 missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   911
  +content3 missing_missing_content3-untracked
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   912
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   913
Test revert to parent content with explicit file name
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   914
-----------------------------------------------------
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   915
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   916
(setup from reference repo)
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   917
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
   918
  $ cp -R revert-ref revert-parent-explicit
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   919
  $ cd revert-parent-explicit
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   920
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   921
revert all files individually and check the output
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   922
(output is expected to be different than in the --all case)
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   923
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
   924
  $ for file in `"$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 2`; do
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   925
  >   echo '### revert for:' $file;
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   926
  >   hg revert $file;
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   927
  >   echo
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   928
  > done
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   929
  ### revert for: content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   930
  no changes needed to content1_content1_content1-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
   931
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   932
  ### revert for: content1_content1_content1-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
   933
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   934
  ### revert for: content1_content1_content3-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
   935
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   936
  ### revert for: content1_content1_content3-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   937
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   938
  ### revert for: content1_content1_missing-tracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
   939
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   940
  ### revert for: content1_content1_missing-untracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
   941
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   942
  ### revert for: content1_content2_content1-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
   943
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   944
  ### revert for: content1_content2_content1-untracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
   945
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   946
  ### revert for: content1_content2_content2-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   947
  no changes needed to content1_content2_content2-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
   948
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   949
  ### revert for: content1_content2_content2-untracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
   950
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   951
  ### revert for: content1_content2_content3-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
   952
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   953
  ### revert for: content1_content2_content3-untracked
22137
2cfe5ec47803 test-revert: add case where file exists neither in "base" nor in "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22136
diff changeset
   954
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   955
  ### revert for: content1_content2_missing-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
   956
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   957
  ### revert for: content1_content2_missing-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
   958
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   959
  ### revert for: content1_missing_content1-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
   960
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   961
  ### revert for: content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   962
  file not managed: content1_missing_content1-untracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
   963
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   964
  ### revert for: content1_missing_content3-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   965
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   966
  ### revert for: content1_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   967
  file not managed: content1_missing_content3-untracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
   968
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   969
  ### revert for: content1_missing_missing-tracked
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   970
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   971
  ### revert for: content1_missing_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   972
  content1_missing_missing-untracked: no such file in rev * (glob)
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
   973
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   974
  ### revert for: missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   975
  no changes needed to missing_content2_content2-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
   976
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   977
  ### revert for: missing_content2_content2-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   978
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   979
  ### revert for: missing_content2_content3-tracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
   980
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   981
  ### revert for: missing_content2_content3-untracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
   982
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   983
  ### revert for: missing_content2_missing-tracked
22136
a29574cb8552 test-revert: add case where the file is removed between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22135
diff changeset
   984
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   985
  ### revert for: missing_content2_missing-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
   986
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   987
  ### revert for: missing_missing_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
   988
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   989
  ### revert for: missing_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
   990
  file not managed: missing_missing_content3-untracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
   991
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   992
  ### revert for: missing_missing_missing-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   993
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   994
  ### revert for: missing_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
   995
  missing_missing_missing-untracked: no such file in rev * (glob)
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
   996
  
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   997
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
   998
check resulting directory against the --all run
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   999
(There should be no difference)
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
  1000
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
  1001
  $ "$PYTHON" ../dircontent.py > ../content-parent-explicit.txt
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
  1002
  $ cd ..
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
  1003
  $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
  1004
  [1]
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1005
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1006
Test revert to "base" content with explicit file name
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1007
-----------------------------------------------------
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1008
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1009
(setup from reference repo)
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1010
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
  1011
  $ cp -R revert-ref revert-base-explicit
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1012
  $ cd revert-base-explicit
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1013
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1014
revert all files individually and check the output
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1015
(output is expected to be different than in the --all case)
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1016
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
  1017
  $ for file in `"$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 2`; do
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1018
  >   echo '### revert for:' $file;
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1019
  >   hg revert $file --rev 'desc(base)';
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1020
  >   echo
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1021
  > done
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1022
  ### revert for: content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1023
  no changes needed to content1_content1_content1-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
  1024
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1025
  ### revert for: content1_content1_content1-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
  1026
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1027
  ### revert for: content1_content1_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
  1028
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1029
  ### revert for: content1_content1_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1030
  
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1031
  ### revert for: content1_content1_missing-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
  1032
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1033
  ### revert for: content1_content1_missing-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1034
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1035
  ### revert for: content1_content2_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1036
  no changes needed to content1_content2_content1-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
  1037
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1038
  ### revert for: content1_content2_content1-untracked
22135
37d2bd2c04f6 test-revert: add case where file is unchanged between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22133
diff changeset
  1039
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1040
  ### revert for: content1_content2_content2-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
  1041
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1042
  ### revert for: content1_content2_content2-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
  1043
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1044
  ### revert for: content1_content2_content3-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
  1045
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1046
  ### revert for: content1_content2_content3-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1047
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1048
  ### revert for: content1_content2_missing-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
  1049
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1050
  ### revert for: content1_content2_missing-untracked
22137
2cfe5ec47803 test-revert: add case where file exists neither in "base" nor in "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22136
diff changeset
  1051
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1052
  ### revert for: content1_missing_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1053
  no changes needed to content1_missing_content1-tracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
  1054
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1055
  ### revert for: content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1056
  
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1057
  ### revert for: content1_missing_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
  1058
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1059
  ### revert for: content1_missing_content3-untracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
  1060
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1061
  ### revert for: content1_missing_missing-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1062
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1063
  ### revert for: content1_missing_missing-untracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
  1064
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1065
  ### revert for: missing_content2_content2-tracked
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1066
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
  1067
  ### revert for: missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
  1068
  no changes needed to missing_content2_content2-untracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
  1069
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1070
  ### revert for: missing_content2_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
  1071
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
  1072
  ### revert for: missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
  1073
  no changes needed to missing_content2_content3-untracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
  1074
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1075
  ### revert for: missing_content2_missing-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
  1076
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1077
  ### revert for: missing_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1078
  no changes needed to missing_content2_missing-untracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
  1079
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1080
  ### revert for: missing_missing_content3-tracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
  1081
  
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1082
  ### revert for: missing_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
  1083
  file not managed: missing_missing_content3-untracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
  1084
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
  1085
  ### revert for: missing_missing_missing-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1086
  
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
  1087
  ### revert for: missing_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
  1088
  missing_missing_missing-untracked: no such file in rev * (glob)
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
  1089
  
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1090
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
  1091
check resulting directory against the --all run
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1092
(There should be no difference)
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1093
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
  1094
  $ "$PYTHON" ../dircontent.py > ../content-base-explicit.txt
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1095
  $ cd ..
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1096
  $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1097
  [1]
28192
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1098
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1099
Revert to an ancestor of P2 during a merge (issue5052)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1100
-----------------------------------------------------
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1101
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1102
(prepare the repository)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1103
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1104
  $ hg init issue5052
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1105
  $ cd issue5052
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1106
  $ echo '.\.orig' > .hgignore
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1107
  $ echo 0 > root
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1108
  $ hg ci -qAm C0
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1109
  $ echo 0 > A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1110
  $ hg ci -qAm C1
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1111
  $ echo 1 >> A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1112
  $ hg ci -qm C2
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1113
  $ hg up -q 0
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1114
  $ echo 1 > B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1115
  $ hg ci -qAm C3
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1116
  $ hg status --rev 'ancestor(.,2)' --rev 2
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1117
  A A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1118
  $ hg log -G -T '{rev} ({files})\n'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1119
  @  3 (B)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1120
  |
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1121
  | o  2 (A)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1122
  | |
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1123
  | o  1 (A)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1124
  |/
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1125
  o  0 (.hgignore root)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1126
  
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1127
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1128
actual tests: reverting to something else than a merge parent
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1129
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1130
  $ hg merge
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1131
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1132
  (branch merge, don't forget to commit)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1133
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1134
  $ hg status --rev 'p1()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1135
  M A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1136
  $ hg status --rev 'p2()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1137
  A B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1138
  $ hg status --rev '1'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1139
  M A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1140
  A B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1141
  $ hg revert --rev 1 --all
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
  1142
  removing B
28192
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1143
  reverting A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1144
  $ hg status --rev 1
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1145
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1146
From the other parents
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1147
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1148
  $ hg up -C 'p2()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1149
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1150
  $ hg merge
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1151
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1152
  (branch merge, don't forget to commit)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1153
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1154
  $ hg status --rev 'p1()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1155
  M B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1156
  $ hg status --rev 'p2()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1157
  A A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1158
  $ hg status --rev '1'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1159
  M A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1160
  A B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1161
  $ hg revert --rev 1 --all
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
  1162
  removing B
28192
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1163
  reverting A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1164
  $ hg status --rev 1
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1165
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
  1166
  $ cd ..