tests/test-revert.t
author Pierre-Yves David <pierre-yves.david@fb.com>
Fri, 27 Jun 2014 18:23:45 +0200
changeset 22142 e1a69b0ac9e6
parent 22141 6b522c1139a9
child 22143 ca278b893940
permissions -rw-r--r--
test-revert: add case with untracked files with reverted content This test highlights similar misbehaviors as its parent changesets.
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)
14745
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
    14
  [255]
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
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    76
  $ ls
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    77
  a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    78
  c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    79
  e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    80
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    81
Test creation of backup (.orig) files
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    82
-------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    83
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    84
  $ echo z > e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    85
  $ hg revert --all -v
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    86
  saving current version of e as e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    87
  reverting e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    88
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    89
revert on clean file (no change)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    90
--------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    91
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    92
  $ hg revert a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    93
  no changes needed to a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    94
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    95
revert on an untracked file
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
    96
---------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    97
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    98
  $ echo q > q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
    99
  $ hg revert q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   100
  file not managed: q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   101
  $ rm q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   102
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   103
revert on file that does not exists
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   104
-----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   105
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   106
  $ hg revert notfound
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   107
  notfound: no such file in rev 334a9e57682c
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   108
  $ touch d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   109
  $ hg add d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   110
  $ hg rm a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   111
  $ hg commit -m "second"
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   112
  $ echo z > z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   113
  $ hg add z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   114
  $ hg st
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   115
  A z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   116
  ? e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   117
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   118
revert to another revision (--rev)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   119
----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   120
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   121
  $ hg revert --all -r0
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   122
  adding a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   123
  removing d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   124
  forgetting z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   125
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   126
revert explicitly to parent (--rev)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   127
-----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   128
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   129
  $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   130
  forgetting a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   131
  undeleting d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   132
  $ rm a *.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   133
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   134
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
   135
--------------------------------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   136
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   137
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
   138
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   139
  $ hg revert -r0 a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   140
  $ hg st a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   141
  A a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   142
  $ hg rm d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   143
  $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   144
  R d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   145
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   146
should silently keep d removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   147
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   148
  $ hg revert -r0 d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   149
  $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   150
  R d
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
   151
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   152
  $ hg update -C
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   153
  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
   154
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   155
revert of exec bit
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   156
------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   157
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
   158
#if execbit
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   159
  $ chmod +x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   160
  $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   161
  reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   162
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   163
  $ test -x c || echo non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   164
  non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   165
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   166
  $ chmod +x c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   167
  $ hg commit -m exe
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
   168
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   169
  $ chmod -x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   170
  $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   171
  reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   172
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   173
  $ test -x c && echo executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   174
  executable
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
   175
#endif
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   176
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   177
  $ cd ..
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   178
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   179
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
   180
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
   181
--------------------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
   182
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   183
  $ hg init a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   184
  $ cd a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   185
  $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   186
  $ hg commit -A -d '1 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   187
  adding a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   188
  $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   189
  $ hg commit -d '2 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   190
  $ hg update 0
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   191
  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
   192
  $ mkdir b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   193
  $ echo b > b/b
2272
e9a0ed9ed4d9 revert: fix corner case found by faheem mitha.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2157
diff changeset
   194
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   195
call `hg revert` with no file specified
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   196
---------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   197
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   198
  $ 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
   199
  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
   200
  (use --all to revert all files, or 'hg update 1' to update)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
   201
  [255]
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   202
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   203
call `hg revert` with --all
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   204
---------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   205
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   206
  $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   207
  reverting a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   208
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   209
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
   210
Issue332: confusing message when reverting directory
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   211
----------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
   212
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
   213
  $ hg ci -A -m b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   214
  adding b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   215
  created new head
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   216
  $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   217
  $ mkdir newdir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   218
  $ echo foo > newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   219
  $ hg add newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   220
  $ hg revert b newdir
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   221
  reverting b/b (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   222
  forgetting newdir/newfile (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   223
  $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   224
  $ hg revert .
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   225
  reverting b/b (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   226
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
   227
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   228
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
   229
--------------------------------------------------
12106
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
  $ hg mv a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   232
  $ hg revert newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   233
  $ hg st a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   234
  ? newa
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
   235
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   236
  $ 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
   237
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   238
  $ hg init ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   239
  $ cd ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   240
  $ echo '^ignored$' > .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   241
  $ echo '^ignoreddir$' >> .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   242
  $ 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
   243
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   244
  $ mkdir ignoreddir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   245
  $ touch ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   246
  $ touch ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   247
  $ touch ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   248
  $ touch removed
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
4 ignored files (we will add/commit everything)
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   251
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   252
  $ hg st -A -X .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   253
  I ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   254
  I ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   255
  I ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   256
  I removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   257
  $ 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
   258
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   259
  $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   260
  $ echo >> ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   261
  $ hg rm removed ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   262
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   263
should revert ignored* and undelete *removed
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   264
--------------------------------------------
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
   265
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   266
  $ hg revert -a --no-backup
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   267
  reverting ignored
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   268
  reverting ignoreddir/file (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
   269
  undeleting ignoreddir/removed (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   270
  undeleting removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   271
  $ hg st -mardi
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   272
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   273
  $ hg up -qC
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   274
  $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   275
  $ hg rm removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   276
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   277
should silently revert the named files
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   278
--------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   279
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   280
  $ hg revert --no-backup ignored removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
   281
  $ hg st -mardi
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16886
diff changeset
   282
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   283
Reverting copy (issue3920)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   284
--------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   285
19129
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   286
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
   287
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   288
  $ rm .hgignore
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   289
  $ hg update -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   290
  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
   291
  $ hg mv ignored allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   292
  $ hg copy removed base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   293
  $ hg commit -m rename
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   294
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   295
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
   296
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   297
  $ hg update '.^'
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   298
  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
   299
  $ hg revert -rtip -a
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   300
  adding allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   301
  adding base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   302
  removing ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   303
  $ hg status -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   304
  A allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   305
    ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   306
  A base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   307
    removed
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   308
  R ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
   309
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   310
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
   311
====================================================
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   312
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   313
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
   314
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   315
  $ 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
   316
  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
   317
  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
   318
  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
   319
  $ 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
   320
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   321
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
   322
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   323
  $ 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
   324
  $ 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
   325
  $ 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
   326
  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
   327
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   328
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   329
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
   330
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   331
  $ 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
   332
  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
   333
  (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
   334
  $ 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
   335
  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
   336
   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
   337
  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
   338
   rename
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   339
  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
   340
  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
   341
  update: (current)
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   342
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   343
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
   344
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   345
  $ 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
   346
  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
   347
  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
   348
  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
   349
  $ 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
   350
  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
   351
  $ 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
   352
  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
   353
  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
   354
  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
   355
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   356
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
   357
-----------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   358
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   359
  $ 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
   360
  $ 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
   361
  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
   362
  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
   363
  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
   364
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   365
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
   366
------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   367
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   368
  $ 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
   369
  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
   370
  $ 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
   371
  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
   372
  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
   373
  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
   374
  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
   375
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   376
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
   377
------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   378
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   379
  $ 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
   380
  $ 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
   381
  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
   382
  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
   383
  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
   384
  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
   385
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
   386
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
   387
------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   388
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
   389
  $ 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
   390
  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
   391
  $ 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
   392
  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
   393
  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
   394
  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
   395
  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
   396
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   397
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
   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
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   400
This section tests most of the possible combinations of working directory
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   401
changes and inter-revision changes. The number of possible cases is significant
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   402
but they all have a slighly different handling. So this section commits to
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   403
generating and testing all of them to allow safe refactoring of the revert code.
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   404
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   405
A python script is used to generate a file history for each combination of
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   406
changes between, on one side the working directory and its parent and on
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   407
the other side, changes between a revert target (--rev) and working directory
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   408
parent. The three states generated are:
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   409
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   410
- a "base" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   411
- a "parent" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   412
- 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
   413
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   414
The file generated have names of the form:
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   415
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   416
 <changeset-state>_<working-copy-state>
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   417
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   418
Here, "changeset-state" conveys the state in "base" and "parent" (or the change
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   419
that happen between them), "working-copy-state" is self explanatory.
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   420
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   421
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
   422
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
   423
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   424
There are also multiple cases where the current revert implementation is known to
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   425
slightly misbehave.
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   426
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   427
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
   428
-------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   429
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   430
  $ cat << EOF > gen-revert-cases.py
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   431
  > # generate proper file state to test revert behavior
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   432
  > import sys
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   433
  > import os
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   434
  > 
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   435
  > # content of the file in "base" and "parent"
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   436
  > # None means no file at all
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   437
  > ctxcontent = {
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
   438
  >     # clean: no change from base to parent
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
   439
  >     'clean': ['base', 'base'],
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   440
  >     # modified: file content change from base to parent
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   441
  >     'modified': ['base', 'parent'],
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   442
  >     # added: file is missing from base and added in parent
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   443
  >     'added': [None, 'parent'],
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
   444
  >     # removed: file exist in base but is removed from parent
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
   445
  >     'removed': ['base', None],
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
   446
  >     # file exist neither in base not in parent
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
   447
  >     'missing': [None, None],
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   448
  > }
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   449
  > 
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   450
  > # content of file in working copy
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   451
  > wccontent = {
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   452
  >     # clean: wc content is the same as parent
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   453
  >     'clean': lambda cc: cc[1],
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
   454
  >     # revert: wc content is the same as base
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
   455
  >     'revert': lambda cc: cc[0],
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
   456
  >     # wc: file exist with a content different from base and parent
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
   457
  >     'wc': lambda cc: 'wc',
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
   458
  >     # removed: file is missing and marked as untracked
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
   459
  >     'removed': lambda cc: None,
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   460
  > }
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
   461
  > # untracked-X is a version of X where the file is not tracked (? unknown)
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
   462
  > wccontent['untracked-clean'] = wccontent['clean']
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   463
  > wccontent['untracked-revert'] = wccontent['revert']
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   464
  > 
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   465
  > # build the combination of possible states
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   466
  > combination = []
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   467
  > for ctxkey in ctxcontent:
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   468
  >     for wckey in wccontent:
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   469
  >         filename = "%s_%s" % (ctxkey, wckey)
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   470
  >         combination.append((filename, ctxkey, wckey))
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   471
  > 
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   472
  > # make sure we have stable output
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   473
  > combination.sort()
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   474
  > 
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   475
  > # retrieve the state we must generate
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   476
  > target = sys.argv[1]
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   477
  > 
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   478
  > # compute file content
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   479
  > content = []
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   480
  > for filename, ctxkey, wckey in combination:
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   481
  >     cc = ctxcontent[ctxkey]
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   482
  >     if target == 'filelist':
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   483
  >         print filename
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   484
  >     elif target == 'base':
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   485
  >         content.append((filename, cc[0]))
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   486
  >     elif target == 'parent':
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   487
  >         content.append((filename, cc[1]))
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   488
  >     elif target == 'wc':
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   489
  >         content.append((filename, wccontent[wckey](cc)))
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   490
  >     else:
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   491
  >         print >> sys.stderr, "unknown target:", target
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   492
  >         sys.exit(1)
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   493
  > 
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   494
  > # write actual content
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   495
  > for filename, data in content:
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   496
  >     if data is not None:
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   497
  >         f = open(filename, 'w')
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   498
  >         f.write(data + '\n')
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   499
  >         f.close()
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   500
  >     elif os.path.exists(filename):
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   501
  >        os.remove(filename)
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   502
  > EOF
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   503
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   504
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
   505
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   506
  $ python gen-revert-cases.py filelist
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   507
  added_clean
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
   508
  added_removed
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
   509
  added_revert
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
   510
  added_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   511
  added_untracked-revert
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
   512
  added_wc
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
   513
  clean_clean
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
   514
  clean_removed
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
   515
  clean_revert
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
   516
  clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   517
  clean_untracked-revert
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
   518
  clean_wc
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
   519
  missing_clean
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
   520
  missing_removed
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
   521
  missing_revert
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
   522
  missing_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   523
  missing_untracked-revert
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
   524
  missing_wc
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   525
  modified_clean
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
   526
  modified_removed
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
   527
  modified_revert
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
   528
  modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   529
  modified_untracked-revert
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
   530
  modified_wc
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
   531
  removed_clean
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
   532
  removed_removed
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
   533
  removed_revert
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
   534
  removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   535
  removed_untracked-revert
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
   536
  removed_wc
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
   537
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   538
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
   539
---------------------------------------------------
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   540
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   541
  $ 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
   542
  > # generate a simple text view of the directory for easy comparison
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   543
  > 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
   544
  > 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
   545
  > 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
   546
  > 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
   547
  >     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
   548
  >         continue
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   549
  >     content = open(filename).read()
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   550
  >     print '%-6s %s' % (content.strip(), filename)
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   551
  > EOF
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   552
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   553
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
   554
-------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   555
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   556
  $ 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
   557
  $ cd revert-ref
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   558
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   559
Generate base changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   560
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   561
  $ python ../gen-revert-cases.py base
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   562
  $ hg addremove --similarity 0
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
   563
  adding clean_clean
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
   564
  adding clean_removed
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
   565
  adding clean_revert
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
   566
  adding clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   567
  adding clean_untracked-revert
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
   568
  adding clean_wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   569
  adding modified_clean
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
   570
  adding modified_removed
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
   571
  adding modified_revert
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
   572
  adding modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   573
  adding modified_untracked-revert
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
   574
  adding modified_wc
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
   575
  adding removed_clean
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
   576
  adding removed_removed
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
   577
  adding removed_revert
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
   578
  adding removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   579
  adding removed_untracked-revert
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
   580
  adding removed_wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   581
  $ hg status
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
   582
  A clean_clean
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
   583
  A clean_removed
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
   584
  A clean_revert
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
   585
  A clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   586
  A clean_untracked-revert
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
   587
  A clean_wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   588
  A modified_clean
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
   589
  A modified_removed
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
   590
  A modified_revert
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
   591
  A modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   592
  A modified_untracked-revert
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
   593
  A modified_wc
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
   594
  A removed_clean
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
   595
  A removed_removed
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
   596
  A removed_revert
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
   597
  A removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   598
  A removed_untracked-revert
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
   599
  A removed_wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   600
  $ 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
   601
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   602
(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
   603
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   604
  $ python ../dircontent.py > ../content-base.txt
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   605
  $ cat ../content-base.txt
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
   606
  base   clean_clean
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
   607
  base   clean_removed
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
   608
  base   clean_revert
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
   609
  base   clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   610
  base   clean_untracked-revert
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
   611
  base   clean_wc
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   612
  base   modified_clean
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
   613
  base   modified_removed
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
   614
  base   modified_revert
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
   615
  base   modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   616
  base   modified_untracked-revert
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
   617
  base   modified_wc
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
   618
  base   removed_clean
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
   619
  base   removed_removed
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
   620
  base   removed_revert
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
   621
  base   removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   622
  base   removed_untracked-revert
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
   623
  base   removed_wc
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   624
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   625
Create parent changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   626
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   627
  $ python ../gen-revert-cases.py parent
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   628
  $ hg addremove --similarity 0
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   629
  adding added_clean
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
   630
  adding added_removed
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
   631
  adding added_revert
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
   632
  adding added_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   633
  adding added_untracked-revert
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
   634
  adding added_wc
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
   635
  removing removed_clean
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
   636
  removing removed_removed
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
   637
  removing removed_revert
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
   638
  removing removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   639
  removing removed_untracked-revert
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
   640
  removing removed_wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   641
  $ hg status
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   642
  M modified_clean
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
   643
  M modified_removed
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
   644
  M modified_revert
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
   645
  M modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   646
  M modified_untracked-revert
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
   647
  M modified_wc
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   648
  A added_clean
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
   649
  A added_removed
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
   650
  A added_revert
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
   651
  A added_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   652
  A added_untracked-revert
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
   653
  A added_wc
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
   654
  R removed_clean
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
   655
  R removed_removed
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
   656
  R removed_revert
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
   657
  R removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   658
  R removed_untracked-revert
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
   659
  R removed_wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   660
  $ 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
   661
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   662
(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
   663
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   664
  $ python ../dircontent.py > ../content-parent.txt
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   665
  $ cat ../content-parent.txt
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   666
  parent added_clean
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
   667
  parent added_removed
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
   668
  parent added_revert
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
   669
  parent added_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   670
  parent added_untracked-revert
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
   671
  parent added_wc
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
   672
  base   clean_clean
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
   673
  base   clean_removed
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
   674
  base   clean_revert
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
   675
  base   clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   676
  base   clean_untracked-revert
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
   677
  base   clean_wc
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   678
  parent modified_clean
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
   679
  parent modified_removed
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
   680
  parent modified_revert
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
   681
  parent modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   682
  parent modified_untracked-revert
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
   683
  parent modified_wc
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
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   685
Setup working directory
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   686
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   687
  $ python ../gen-revert-cases.py wc | cat
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   688
  $ hg addremove --similarity 0
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
   689
  removing added_removed
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
   690
  removing added_revert
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   691
  removing added_untracked-revert
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
   692
  removing clean_removed
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
   693
  adding missing_wc
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
   694
  removing modified_removed
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
   695
  adding removed_revert
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   696
  adding removed_untracked-revert
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
   697
  adding removed_wc
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
   698
  $ hg forget *untracked*
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   699
  $ hg status
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
   700
  M added_wc
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
   701
  M clean_wc
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
   702
  M modified_revert
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
   703
  M modified_wc
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
   704
  A missing_wc
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
   705
  A removed_revert
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
   706
  A removed_wc
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
   707
  R added_removed
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
   708
  R added_revert
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
   709
  R added_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   710
  R added_untracked-revert
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
   711
  R clean_removed
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
   712
  R clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   713
  R clean_untracked-revert
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
   714
  R modified_removed
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
   715
  R modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   716
  R modified_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   717
  ? removed_untracked-revert
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   718
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   719
  $ hg status --rev 'desc("base")'
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
   720
  M clean_wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   721
  M modified_clean
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
   722
  M modified_wc
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
   723
  M removed_wc
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   724
  A added_clean
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
   725
  A added_wc
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
   726
  A missing_wc
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
   727
  R clean_removed
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
   728
  R clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   729
  R clean_untracked-revert
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
   730
  R modified_removed
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
   731
  R modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   732
  R modified_untracked-revert
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
   733
  R removed_clean
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
   734
  R removed_removed
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
   735
  R removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   736
  R removed_untracked-revert
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   737
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   738
(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
   739
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   740
  $ python ../dircontent.py > ../content-wc.txt
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   741
  $ cat ../content-wc.txt
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   742
  parent added_clean
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
   743
  parent added_untracked-clean
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
   744
  wc     added_wc
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
   745
  base   clean_clean
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
   746
  base   clean_revert
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
   747
  base   clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   748
  base   clean_untracked-revert
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
   749
  wc     clean_wc
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
   750
  wc     missing_wc
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   751
  parent modified_clean
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
   752
  base   modified_revert
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
   753
  parent modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   754
  base   modified_untracked-revert
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
   755
  wc     modified_wc
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
   756
  base   removed_revert
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   757
  base   removed_untracked-revert
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
   758
  wc     removed_wc
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
   759
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   760
  $ cd ..
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
   761
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   762
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
   763
-----------------------------------
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   764
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   765
(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
   766
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   767
  $ cp -r revert-ref 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
   768
  $ 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
   769
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   770
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
   771
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   772
  $ hg revert --all
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
   773
  undeleting added_removed
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
   774
  undeleting added_revert
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
   775
  undeleting added_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   776
  undeleting added_untracked-revert
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
   777
  reverting added_wc
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
   778
  undeleting clean_removed
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
   779
  undeleting clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   780
  undeleting clean_untracked-revert
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
   781
  reverting clean_wc
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
   782
  forgetting missing_wc
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
   783
  undeleting modified_removed
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
   784
  reverting modified_revert
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
   785
  undeleting modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   786
  undeleting modified_untracked-revert
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
   787
  reverting modified_wc
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
   788
  forgetting removed_revert
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
   789
  forgetting removed_wc
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   790
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   791
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
   792
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   793
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
   794
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
   795
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   796
  $ python ../dircontent.py > ../content-parent-all.txt
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   797
  $ cd ..
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
   798
  $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
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
   799
  +wc     added_wc.orig
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
   800
  +wc     clean_wc.orig
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
   801
  +wc     missing_wc
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
   802
  +base   modified_revert.orig
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   803
  +base   modified_untracked-revert.orig
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
   804
  +wc     modified_wc.orig
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
   805
  +base   removed_revert
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   806
  +base   removed_untracked-revert
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
   807
  +wc     removed_wc
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   808
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   809
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
   810
-----------------------------------
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   811
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   812
(setup from reference repo)
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   813
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   814
  $ cp -r revert-ref revert-base-all
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   815
  $ cd revert-base-all
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   816
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   817
check revert output
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   818
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
   819
Misbehavior:
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
   820
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
   821
- report "reverting" when file needs no changes
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
   822
|
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
   823
| - reverting modified_revert
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
   824
| - reverting removed_revert
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
   825
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   826
  $ hg revert --all --rev 'desc(base)'
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   827
  removing added_clean
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
   828
  removing added_wc
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
   829
  undeleting clean_removed
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
   830
  undeleting clean_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   831
  undeleting clean_untracked-revert
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
   832
  reverting clean_wc
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
   833
  forgetting missing_wc
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   834
  reverting modified_clean
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
   835
  undeleting modified_removed
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
   836
  reverting modified_revert
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
   837
  undeleting modified_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   838
  undeleting modified_untracked-revert
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
   839
  reverting modified_wc
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
   840
  adding removed_clean
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
   841
  adding removed_removed
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
   842
  reverting removed_revert
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
   843
  adding removed_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   844
  adding removed_untracked-revert
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
   845
  reverting removed_wc
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   846
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   847
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
   848
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   849
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
   850
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
   851
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
   852
Misbehavior:
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
   853
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
   854
- no backup for
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
   855
| - added_wc (DATA LOSS)
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
   856
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   857
  $ python ../dircontent.py > ../content-base-all.txt
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   858
  $ cd ..
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
   859
  $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
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
   860
  +parent added_untracked-clean
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
   861
  +wc     clean_wc.orig
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
   862
  +wc     missing_wc
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
   863
  +parent modified_untracked-clean.orig
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
   864
  +wc     modified_wc.orig
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
   865
  +wc     removed_wc.orig
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   866
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   867
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
   868
-----------------------------------------------------
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   869
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   870
(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
   871
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   872
  $ cp -r revert-ref 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
   873
  $ 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
   874
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   875
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
   876
(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
   877
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   878
  $ for file in `python ../gen-revert-cases.py filelist`; do
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   879
  >   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
   880
  >   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
   881
  >   echo
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   882
  > done
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   883
  ### revert for: added_clean
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   884
  no changes needed to added_clean
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   885
  
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
   886
  ### revert for: added_removed
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
   887
  
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
   888
  ### revert for: added_revert
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
   889
  
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
   890
  ### revert for: added_untracked-clean
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
   891
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   892
  ### revert for: added_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   893
  
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
   894
  ### revert for: added_wc
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
   895
  
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
   896
  ### revert for: clean_clean
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
   897
  no changes needed to clean_clean
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
   898
  
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
   899
  ### revert for: clean_removed
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
   900
  
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
   901
  ### revert for: clean_revert
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
   902
  no changes needed to clean_revert
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
   903
  
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
   904
  ### revert for: clean_untracked-clean
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
   905
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   906
  ### revert for: clean_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   907
  
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
   908
  ### revert for: clean_wc
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
   909
  
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
   910
  ### revert for: missing_clean
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
   911
  missing_clean: no such file in rev * (glob)
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
   912
  
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
   913
  ### revert for: missing_removed
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
   914
  missing_removed: no such file in rev * (glob)
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
   915
  
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
   916
  ### revert for: missing_revert
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
   917
  missing_revert: no such file in rev * (glob)
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
   918
  
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
   919
  ### revert for: missing_untracked-clean
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
   920
  missing_untracked-clean: no such file in rev * (glob)
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
   921
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   922
  ### revert for: missing_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   923
  missing_untracked-revert: no such file in rev * (glob)
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   924
  
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
   925
  ### revert for: missing_wc
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
   926
  
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   927
  ### revert for: modified_clean
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   928
  no changes needed to modified_clean
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   929
  
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
   930
  ### revert for: modified_removed
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
   931
  
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
   932
  ### revert for: modified_revert
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
   933
  
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
   934
  ### revert for: modified_untracked-clean
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
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   936
  ### revert for: modified_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   937
  
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
   938
  ### revert for: modified_wc
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
   939
  
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
   940
  ### revert for: removed_clean
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
   941
  removed_clean: no such file in rev * (glob)
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
   942
  
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
   943
  ### revert for: removed_removed
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
   944
  removed_removed: no such file in rev * (glob)
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
   945
  
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
   946
  ### revert for: removed_revert
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
   947
  
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
  ### revert for: removed_untracked-clean
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
   949
  removed_untracked-clean: no such file in rev * (glob)
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
   950
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   951
  ### revert for: removed_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   952
  file not managed: removed_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   953
  
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
   954
  ### revert for: removed_wc
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
   955
  
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   956
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   957
check resulting directory againt the --all run
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   958
(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
   959
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   960
  $ python ../dircontent.py > ../content-parent-explicit.txt
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   961
  $ cd ..
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
   962
  $ 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
   963
  [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
   964
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
   965
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
   966
-----------------------------------------------------
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
   967
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
   968
(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
   969
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
   970
  $ cp -r revert-ref 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
   971
  $ 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
   972
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
   973
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
   974
(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
   975
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
   976
Misbehavior:
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
   977
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
   978
- fails to report no change to revert for
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
   979
|
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
   980
| - clean_clean
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
   981
| - added_revert
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
   982
| - clean_revert
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
   983
| - modified_revert
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
   984
| - removed_revert
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
   985
| - added_removed
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
   986
| - added_untracked-clean
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
   987
| - added_untracked-revert
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
   988
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
   989
  $ for file in `python ../gen-revert-cases.py filelist`; do
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
   990
  >   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
   991
  >   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
   992
  >   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
   993
  > done
22133
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   994
  ### revert for: added_clean
d732ff677b96 test-revert: add case where file is added between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22131
diff changeset
   995
  
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
   996
  ### revert for: added_removed
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
   997
  
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
   998
  ### revert for: added_revert
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
   999
  
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
  1000
  ### revert for: added_untracked-clean
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
  1001
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1002
  ### revert for: added_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1003
  
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
  1004
  ### revert for: added_wc
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
  1005
  
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
  1006
  ### revert for: clean_clean
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
  1007
  
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
  1008
  ### revert for: clean_removed
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
  1009
  
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
  1010
  ### revert for: clean_revert
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
  1011
  
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
  1012
  ### revert for: clean_untracked-clean
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
  1013
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1014
  ### revert for: clean_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1015
  
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
  1016
  ### revert for: clean_wc
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
  1017
  
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
  1018
  ### revert for: missing_clean
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
  1019
  missing_clean: no such file in rev * (glob)
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
  1020
  
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
  1021
  ### revert for: missing_removed
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
  1022
  missing_removed: no such file in rev * (glob)
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
  1023
  
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
  1024
  ### revert for: missing_revert
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
  1025
  missing_revert: no such file in rev * (glob)
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
  1026
  
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
  1027
  ### revert for: missing_untracked-clean
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
  1028
  missing_untracked-clean: no such file in rev * (glob)
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
  1029
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1030
  ### revert for: missing_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1031
  missing_untracked-revert: no such file in rev * (glob)
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1032
  
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
  1033
  ### revert for: missing_wc
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
  1034
  
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
  1035
  ### revert for: modified_clean
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1036
  
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
  1037
  ### revert for: modified_removed
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
  1038
  
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
  1039
  ### revert for: modified_revert
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
  1040
  
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
  1041
  ### revert for: modified_untracked-clean
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
  1042
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1043
  ### revert for: modified_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1044
  
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
  1045
  ### revert for: modified_wc
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
  1046
  
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
  1047
  ### revert for: removed_clean
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
  1048
  
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
  1049
  ### revert for: removed_removed
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
  1050
  
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
  1051
  ### revert for: removed_revert
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
  1052
  
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
  1053
  ### revert for: removed_untracked-clean
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
  1054
  
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1055
  ### revert for: removed_untracked-revert
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
  1056
  
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
  1057
  ### revert for: removed_wc
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
  1058
  
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
  1059
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1060
check resulting directory againt the --all run
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1061
(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
  1062
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1063
  $ python ../dircontent.py > ../content-base-explicit.txt
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
  1064
  $ 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
  1065
  $ 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
  1066
  [1]