annotate tests/test-revert.t @ 25727:b8245386ab40

templatekw: make {latesttag} a hybrid list This maintains the previous behavior of expanding {latesttag} to a string containing all of the tags, joined by ':'. But now it also allows list type operations. I'm unsure if the plural handling is correct (i.e. it seems like it is usually "{foos % '{foo}'}"), but I guess we are stuck with this because the singular form previously existed.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 Jul 2015 23:23:22 -0400
parents 6084926366b9
children fe03f522dda9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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
22156
03a45eff9d2b revert: issue "no changes needed" message for files missing on both side
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22144
diff changeset
146 should keep d removed
12106
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
22156
03a45eff9d2b revert: issue "no changes needed" message for files missing on both side
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22144
diff changeset
149 no changes needed to d
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
150 $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
151 R d
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
152
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
153 $ hg update -C
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
154 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
155
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
156 revert of exec bit
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
157 ------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
158
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
159 #if execbit
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
160 $ chmod +x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
161 $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
162 reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
163
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
164 $ test -x c || echo non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
165 non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
166
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
167 $ chmod +x c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
168 $ hg commit -m exe
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
169
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
170 $ chmod -x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
171 $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
172 reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
173
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
174 $ test -x c && echo executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
175 executable
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
176 #endif
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
177
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
178 $ cd ..
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
179
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
180
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
181 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
182 --------------------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
183
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
184 $ hg init a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
185 $ cd a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
186 $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
187 $ hg commit -A -d '1 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
188 adding a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
189 $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
190 $ hg commit -d '2 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
191 $ hg update 0
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
192 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
193 $ mkdir b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
194 $ echo b > b/b
2272
e9a0ed9ed4d9 revert: fix corner case found by faheem mitha.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2157
diff changeset
195
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
196 call `hg revert` with no file specified
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
197 ---------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
198
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
199 $ 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
200 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
201 (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
202 [255]
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
203
24841
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
204 call `hg revert` with -I
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
205 ---------------------------
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
206
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
207 $ echo a >> a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
208 $ hg revert -I a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
209 reverting a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
210
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
211 call `hg revert` with -X
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
212 ---------------------------
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
213
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
214 $ echo a >> a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
215 $ hg revert -X d
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
216 reverting a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
217
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
218 call `hg revert` with --all
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
219 ---------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
220
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
221 $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
222 reverting a
24841
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
223 $ rm *.orig
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
224
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
225 Issue332: confusing message when reverting directory
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
226 ----------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
227
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
228 $ hg ci -A -m b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
229 adding b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
230 created new head
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
231 $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
232 $ mkdir newdir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
233 $ echo foo > newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
234 $ hg add newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
235 $ hg revert b newdir
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
236 reverting b/b (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
237 forgetting newdir/newfile (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
238 $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
239 $ hg revert .
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
240 reverting b/b (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
241
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
242
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
243 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
244 --------------------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
245
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
246 $ hg mv a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
247 $ hg revert newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
248 $ hg st a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
249 ? newa
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
250
23403
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
251 Also true for move overwriting an existing file
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
252
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
253 $ hg mv --force a b/b
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
254 $ hg revert b/b
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
255 $ hg status a b/b
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
256
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
257 $ 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
258
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
259 $ hg init ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
260 $ cd ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
261 $ echo '^ignored$' > .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
262 $ echo '^ignoreddir$' >> .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
263 $ 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
264
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
265 $ mkdir ignoreddir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
266 $ touch ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
267 $ touch ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
268 $ touch ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
269 $ touch removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
270
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
271 4 ignored files (we will add/commit everything)
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 st -A -X .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
274 I ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
275 I ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
276 I ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
277 I removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
278 $ 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
279
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
280 $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
281 $ echo >> ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
282 $ hg rm removed ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
283
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
284 should revert ignored* and undelete *removed
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
285 --------------------------------------------
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
286
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
287 $ hg revert -a --no-backup
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
288 reverting ignored
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
289 reverting ignoreddir/file (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
290 undeleting ignoreddir/removed (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
291 undeleting removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
292 $ hg st -mardi
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
293
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
294 $ hg up -qC
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
295 $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
296 $ hg rm removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
297
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
298 should silently revert the named files
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
299 --------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
300
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
301 $ hg revert --no-backup ignored removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
302 $ hg st -mardi
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16886
diff changeset
303
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
304 Reverting copy (issue3920)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
305 --------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
306
19129
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
307 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
308
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
309 $ rm .hgignore
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
310 $ hg update -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
311 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
312 $ hg mv ignored allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
313 $ hg copy removed base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
314 $ hg commit -m rename
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
315
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
316 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
317
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
318 $ hg update '.^'
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
319 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
320 $ hg revert -rtip -a
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
321 adding allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
322 adding base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
323 removing ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
324 $ hg status -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
325 A allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
326 ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
327 A base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
328 removed
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
329 R ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
330
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
331 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
332 ====================================================
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
333
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
334 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
335
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
336 $ 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
337 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
338 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
339 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
340 $ 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
341
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
342 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
343
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
344 $ 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
345 $ 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
346 $ 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
347 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
348
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
349
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
350 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
351
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
352 $ 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
353 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
354 (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
355 $ 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
356 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
357 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
358 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
359 rename
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
360 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
361 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
362 update: (current)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25111
diff changeset
363 phases: 3 draft
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
364
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
365 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
366
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
367 $ 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
368 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
369 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
370 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
371 $ 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
372 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
373 $ 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
374 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
375 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
376 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
377
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
378 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
379 -----------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
380
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
381 $ 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
382 $ 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
383 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
384 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
385 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
386
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
387 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
388 ------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
389
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
390 $ 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
391 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
392 $ 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
393 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
394 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
395 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
396 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
397
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
398 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
399 ------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
400
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
401 $ 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
402 $ 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
403 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
404 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
405 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
406 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
407
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
408 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
409 ------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
410
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
411 $ 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
412 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
413 $ 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
414 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
415 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
416 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
417 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
418
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
419 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
420 =====================================================
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
421
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
422 This section tests most of the possible combinations of revision states and
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
423 working directory states. The number of possible cases is significant but they
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
424 but they all have a slightly different handling. So this section commits to
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
425 and testing all of them to allow safe refactoring of the revert code.
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
426
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
427 A python script is used to generate a file history for each combination of
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
428 states, on one side the content (or lack thereof) in two revisions, and
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
429 on the other side, the content and "tracked-ness" of the working directory. The
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
430 three states generated are:
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
431
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
432 - a "base" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
433 - a "parent" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
434 - 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
435
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
436 The files generated have names of the form:
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
437
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
438 <rev1-content>_<rev2-content>_<working-copy-content>-<tracked-ness>
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
439
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
440 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
441 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
442
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
443 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
444 -------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
445
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
446 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
447
23447
815e76a45b24 generate-working-copy-states: accept depth arguments on command line
Martin von Zweigbergk <martinvonz@google.com>
parents: 23404
diff changeset
448 $ python $TESTDIR/generate-working-copy-states.py filelist 2
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
449 content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
450 content1_content1_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
451 content1_content1_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
452 content1_content1_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
453 content1_content1_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
454 content1_content1_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
455 content1_content2_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
456 content1_content2_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
457 content1_content2_content2-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
458 content1_content2_content2-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
459 content1_content2_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
460 content1_content2_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
461 content1_content2_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
462 content1_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
463 content1_missing_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
464 content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
465 content1_missing_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
466 content1_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
467 content1_missing_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
468 content1_missing_missing-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
469 missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
470 missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
471 missing_content2_content3-tracked
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
472 missing_content2_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
473 missing_content2_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
474 missing_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
475 missing_missing_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
476 missing_missing_content3-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
477 missing_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
478 missing_missing_missing-untracked
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
479
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
480 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
481 ---------------------------------------------------
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
482
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
483 $ 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
484 > # 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
485 > 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
486 > 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
487 > 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
488 > 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
489 > 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
490 > continue
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
491 > 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
492 > 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
493 > EOF
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
494
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
495 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
496 -------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
497
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
498 $ 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
499 $ cd revert-ref
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
500
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
501 Generate base changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
502
23447
815e76a45b24 generate-working-copy-states: accept depth arguments on command line
Martin von Zweigbergk <martinvonz@google.com>
parents: 23404
diff changeset
503 $ python $TESTDIR/generate-working-copy-states.py state 2 1
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
504 $ hg addremove --similarity 0
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
505 adding content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
506 adding content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
507 adding content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
508 adding content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
509 adding content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
510 adding content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
511 adding content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
512 adding content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
513 adding content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
514 adding content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
515 adding content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
516 adding content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
517 adding content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
518 adding content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
519 adding content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
520 adding content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
521 adding content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
522 adding content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
523 adding content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
524 adding content1_missing_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
525 $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
526 A content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
527 A content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
528 A content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
529 A content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
530 A content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
531 A content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
532 A content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
533 A content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
534 A content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
535 A content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
536 A content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
537 A content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
538 A content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
539 A content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
540 A content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
541 A content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
542 A content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
543 A content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
544 A content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
545 A content1_missing_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
546 $ 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
547
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
548 (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
549
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
550 $ 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
551 $ cat ../content-base.txt
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
552 content1 content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
553 content1 content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
554 content1 content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
555 content1 content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
556 content1 content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
557 content1 content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
558 content1 content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
559 content1 content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
560 content1 content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
561 content1 content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
562 content1 content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
563 content1 content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
564 content1 content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
565 content1 content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
566 content1 content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
567 content1 content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
568 content1 content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
569 content1 content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
570 content1 content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
571 content1 content1_missing_missing-untracked
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
572
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
573 Create parent changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
574
23447
815e76a45b24 generate-working-copy-states: accept depth arguments on command line
Martin von Zweigbergk <martinvonz@google.com>
parents: 23404
diff changeset
575 $ python $TESTDIR/generate-working-copy-states.py state 2 2
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
576 $ hg addremove --similarity 0
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
577 removing content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
578 removing content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
579 removing content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
580 removing content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
581 removing content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
582 removing content1_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
583 adding missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
584 adding missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
585 adding missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
586 adding missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
587 adding missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
588 adding missing_content2_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
589 $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
590 M content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
591 M content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
592 M content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
593 M content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
594 M content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
595 M content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
596 M content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
597 M content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
598 A missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
599 A missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
600 A missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
601 A missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
602 A missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
603 A missing_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
604 R content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
605 R content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
606 R content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
607 R content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
608 R content1_missing_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
609 R content1_missing_missing-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
610 $ 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
611
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 (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
613
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
614 $ 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
615 $ cat ../content-parent.txt
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
616 content1 content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
617 content1 content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
618 content1 content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
619 content1 content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
620 content1 content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
621 content1 content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
622 content2 content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
623 content2 content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
624 content2 content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
625 content2 content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
626 content2 content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
627 content2 content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
628 content2 content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
629 content2 content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
630 content2 missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
631 content2 missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
632 content2 missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
633 content2 missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
634 content2 missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
635 content2 missing_content2_missing-untracked
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
636
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
637 Setup working directory
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
638
23447
815e76a45b24 generate-working-copy-states: accept depth arguments on command line
Martin von Zweigbergk <martinvonz@google.com>
parents: 23404
diff changeset
639 $ python $TESTDIR/generate-working-copy-states.py state 2 wc
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
640 $ hg addremove --similarity 0
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
641 adding content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
642 adding content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
643 adding content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
644 adding content1_missing_content3-untracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
645 adding content1_missing_missing-tracked
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
646 adding content1_missing_missing-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
647 adding missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
648 adding missing_missing_content3-untracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
649 adding missing_missing_missing-tracked
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
650 adding missing_missing_missing-untracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
651 $ hg forget *_*_*-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
652 $ rm *_*_missing-*
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
653 $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
654 M content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
655 M content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
656 M content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
657 M missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
658 A content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
659 A content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
660 A missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
661 R content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
662 R content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
663 R content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
664 R content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
665 R content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
666 R content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
667 R content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
668 R missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
669 R missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
670 R missing_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
671 ! content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
672 ! content1_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
673 ! content1_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
674 ! missing_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
675 ! missing_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
676 ? content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
677 ? content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
678 ? missing_missing_content3-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
679
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
680 $ hg status --rev 'desc("base")'
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
681 M content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
682 M content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
683 M content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
684 M content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
685 A missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
686 A missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
687 A missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
688 R content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
689 R content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
690 R content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
691 R content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
692 R content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
693 R content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
694 R content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
695 R content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
696 R content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
697 R content1_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
698 ! content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
699 ! content1_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
700 ! content1_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
701 ! missing_content2_missing-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
702 ! missing_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
703 ? missing_missing_content3-untracked
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
704
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
705 (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
706
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
707 $ 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
708 $ cat ../content-wc.txt
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
709 content1 content1_content1_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
710 content1 content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
711 content3 content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
712 content3 content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
713 content1 content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
714 content1 content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
715 content2 content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
716 content2 content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
717 content3 content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
718 content3 content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
719 content1 content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
720 content1 content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
721 content3 content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
722 content3 content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
723 content2 missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
724 content2 missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
725 content3 missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
726 content3 missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
727 content3 missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
728 content3 missing_missing_content3-untracked
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
729
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
730 $ cd ..
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
731
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
732 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
733 -----------------------------------
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
734
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
735 (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
736
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
737 $ 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
738 $ 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
739
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
740 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
741
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
742 $ hg revert --all
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
743 undeleting content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
744 reverting content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
745 undeleting content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
746 reverting content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
747 undeleting content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
748 reverting content1_content2_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
749 undeleting content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
750 undeleting content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
751 reverting content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
752 undeleting content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
753 reverting content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
754 undeleting content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
755 forgetting content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
756 forgetting content1_missing_content3-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
757 forgetting content1_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
758 undeleting missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
759 reverting missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
760 undeleting missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
761 reverting missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
762 undeleting missing_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
763 forgetting missing_missing_content3-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
764 forgetting missing_missing_missing-tracked
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
765
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
766 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
767
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
768 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
769 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
770
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
771 $ 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
772 $ cd ..
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
773 $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
774 +content3 content1_content1_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
775 +content3 content1_content1_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
776 +content1 content1_content2_content1-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
777 +content1 content1_content2_content1-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
778 +content3 content1_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
779 +content3 content1_content2_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
780 +content1 content1_missing_content1-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
781 +content1 content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
782 +content3 content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
783 +content3 content1_missing_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
784 +content3 missing_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
785 +content3 missing_content2_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
786 +content3 missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
787 +content3 missing_missing_content3-untracked
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
788
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
789 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
790 -----------------------------------
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
791
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
792 (setup from reference repo)
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
793
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
794 $ 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
795 $ cd revert-base-all
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
796
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
797 check revert output
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
798
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
799 $ hg revert --all --rev 'desc(base)'
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
800 undeleting content1_content1_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
801 reverting content1_content1_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
802 undeleting content1_content1_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
803 reverting content1_content1_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
804 undeleting content1_content1_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
805 undeleting content1_content2_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
806 reverting content1_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
807 undeleting content1_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
808 reverting content1_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
809 undeleting content1_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
810 reverting content1_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
811 undeleting content1_content2_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
812 adding content1_missing_content1-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
813 reverting content1_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
814 adding content1_missing_content3-untracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
815 reverting content1_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
816 adding content1_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
817 removing missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
818 removing missing_content2_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
819 removing missing_content2_missing-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
820 forgetting missing_missing_content3-tracked
23161
6f31f46b8544 test-revert: make sure all 'tracked' files are really tracked
Martin von Zweigbergk <martinvonz@google.com>
parents: 23160
diff changeset
821 forgetting missing_missing_missing-tracked
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
822
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
823 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
824
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
825 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
826 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
827
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
828 $ 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
829 $ cd ..
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
830 $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
831 +content3 content1_content1_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
832 +content3 content1_content1_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
833 +content2 content1_content2_content2-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
834 +content3 content1_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
835 +content3 content1_content2_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
836 +content3 content1_missing_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
837 +content3 content1_missing_content3-untracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
838 +content2 missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
839 +content3 missing_content2_content3-tracked.orig
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
840 +content3 missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
841 +content3 missing_missing_content3-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
842 +content3 missing_missing_content3-untracked
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
843
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
844 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
845 -----------------------------------------------------
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
846
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
847 (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
848
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
849 $ 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
850 $ 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
851
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
852 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
853 (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
854
23447
815e76a45b24 generate-working-copy-states: accept depth arguments on command line
Martin von Zweigbergk <martinvonz@google.com>
parents: 23404
diff changeset
855 $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
856 > 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
857 > 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
858 > echo
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
859 > done
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
860 ### revert for: content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
861 no changes needed to content1_content1_content1-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
862
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
863 ### revert for: content1_content1_content1-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
864
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
865 ### revert for: content1_content1_content3-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
866
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
867 ### revert for: content1_content1_content3-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
868
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
869 ### revert for: content1_content1_missing-tracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
870
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
871 ### revert for: content1_content1_missing-untracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
872
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
873 ### revert for: content1_content2_content1-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
874
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
875 ### revert for: content1_content2_content1-untracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
876
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
877 ### revert for: content1_content2_content2-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
878 no changes needed to content1_content2_content2-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
879
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
880 ### revert for: content1_content2_content2-untracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
881
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
882 ### revert for: content1_content2_content3-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
883
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
884 ### revert for: content1_content2_content3-untracked
22137
2cfe5ec47803 test-revert: add case where file exists neither in "base" nor in "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22136
diff changeset
885
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
886 ### revert for: content1_content2_missing-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
887
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
888 ### revert for: content1_content2_missing-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
889
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
890 ### revert for: content1_missing_content1-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
891
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
892 ### revert for: content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
893 file not managed: content1_missing_content1-untracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
894
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
895 ### revert for: content1_missing_content3-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
896
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
897 ### revert for: content1_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
898 file not managed: content1_missing_content3-untracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
899
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
900 ### revert for: content1_missing_missing-tracked
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
901
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
902 ### revert for: content1_missing_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
903 content1_missing_missing-untracked: no such file in rev * (glob)
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
904
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
905 ### revert for: missing_content2_content2-tracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
906 no changes needed to missing_content2_content2-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
907
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
908 ### revert for: missing_content2_content2-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
909
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
910 ### revert for: missing_content2_content3-tracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
911
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
912 ### revert for: missing_content2_content3-untracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
913
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
914 ### revert for: missing_content2_missing-tracked
22136
a29574cb8552 test-revert: add case where the file is removed between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22135
diff changeset
915
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
916 ### revert for: missing_content2_missing-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
917
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
918 ### revert for: missing_missing_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
919
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
920 ### revert for: missing_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
921 file not managed: missing_missing_content3-untracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
922
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
923 ### revert for: missing_missing_missing-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
924
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
925 ### revert for: missing_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
926 missing_missing_missing-untracked: no such file in rev * (glob)
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
927
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
928
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
929 check resulting directory against the --all run
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
930 (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
931
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
932 $ 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
933 $ cd ..
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
934 $ 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
935 [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
936
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
937 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
938 -----------------------------------------------------
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
939
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
940 (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
941
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
942 $ 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
943 $ 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
944
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
945 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
946 (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
947
23447
815e76a45b24 generate-working-copy-states: accept depth arguments on command line
Martin von Zweigbergk <martinvonz@google.com>
parents: 23404
diff changeset
948 $ for file in `python $TESTDIR/generate-working-copy-states.py filelist 2`; do
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
949 > 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
950 > 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
951 > 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
952 > done
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
953 ### revert for: content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
954 no changes needed to content1_content1_content1-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
955
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
956 ### revert for: content1_content1_content1-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
957
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
958 ### revert for: content1_content1_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
959
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
960 ### revert for: content1_content1_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
961
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
962 ### revert for: content1_content1_missing-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
963
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
964 ### revert for: content1_content1_missing-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
965
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
966 ### revert for: content1_content2_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
967 no changes needed to content1_content2_content1-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
968
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
969 ### revert for: content1_content2_content1-untracked
22135
37d2bd2c04f6 test-revert: add case where file is unchanged between "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22133
diff changeset
970
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
971 ### revert for: content1_content2_content2-tracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
972
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
973 ### revert for: content1_content2_content2-untracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
974
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
975 ### revert for: content1_content2_content3-tracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
976
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
977 ### revert for: content1_content2_content3-untracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
978
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
979 ### revert for: content1_content2_missing-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
980
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
981 ### revert for: content1_content2_missing-untracked
22137
2cfe5ec47803 test-revert: add case where file exists neither in "base" nor in "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22136
diff changeset
982
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
983 ### revert for: content1_missing_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
984 no changes needed to content1_missing_content1-tracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
985
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
986 ### revert for: content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
987
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
988 ### revert for: content1_missing_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
989
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
990 ### revert for: content1_missing_content3-untracked
22141
6b522c1139a9 test-revert: add case where file exists but is untracked in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22140
diff changeset
991
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
992 ### revert for: content1_missing_missing-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
993
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
994 ### revert for: content1_missing_missing-untracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
995
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
996 ### revert for: missing_content2_content2-tracked
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
997
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
998 ### revert for: missing_content2_content2-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
999 no changes needed to missing_content2_content2-untracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
1000
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1001 ### revert for: missing_content2_content3-tracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
1002
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1003 ### revert for: missing_content2_content3-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1004 no changes needed to missing_content2_content3-untracked
22143
ca278b893940 test-revert: add case with untracked files with unique content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22142
diff changeset
1005
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1006 ### revert for: missing_content2_missing-tracked
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
1007
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1008 ### revert for: missing_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1009 no changes needed to missing_content2_missing-untracked
22144
b7c9f07b76c1 test-revert: add case where file is tracked but deleted in working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22143
diff changeset
1010
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1011 ### revert for: missing_missing_content3-tracked
22140
74e932047975 test-revert: add case where the file is marked as removed in the wc
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22139
diff changeset
1012
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1013 ### revert for: missing_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1014 file not managed: missing_missing_content3-untracked
22138
80206e63c3cc test-revert: add case where wc content is already reverted to base content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22137
diff changeset
1015
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1016 ### revert for: missing_missing_missing-tracked
22142
e1a69b0ac9e6 test-revert: add case with untracked files with reverted content
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22141
diff changeset
1017
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1018 ### revert for: missing_missing_missing-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1019 missing_missing_missing-untracked: no such file in rev * (glob)
22139
1ecd6f1f9869 test-revert: add case where wc content is different from "base" and "parent"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22138
diff changeset
1020
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
1021
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
1022 check resulting directory against the --all run
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
1023 (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
1024
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
1025 $ 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
1026 $ 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
1027 $ 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
1028 [1]