annotate tests/test-revert.t @ 40955:f6187e60f792

help: present boolean arguments as "--[no-]foo" This should make it much more discoverable (we document it in `hg help flags`, but most users don't think to look there). Note that flags that default to None (and not False) will not get this new presentation. We can change the defaults to False later for flags where it makes sense (probably almost all boolean flags). Differential Revision: https://phab.mercurial-scm.org/D5432
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 14 Dec 2018 13:44:46 -0800
parents e0a7cfa9323f
children 4d4842445afc
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
26938
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
89 Test creation of backup (.orig) file in configured file location
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
90 ----------------------------------------------------------------
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
91
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
92 $ echo z > e
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
93 $ hg revert --all -v --config 'ui.origbackuppath=.hg/origbackups'
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
94 creating directory: $TESTTMP/repo/.hg/origbackups
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
95 saving current version of e as $TESTTMP/repo/.hg/origbackups/e
26938
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
96 reverting e
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
97 $ rm -rf .hg/origbackups
080276d377d9 revert: allow configuring the .orig file location
Christian Delahousse <cdelahousse@fb.com>
parents: 25753
diff changeset
98
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
99 revert on clean file (no change)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
100 --------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
101
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
102 $ hg revert a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
103 no changes needed to a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
104
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
105 revert on an untracked file
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
106 ---------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
107
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
108 $ echo q > q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
109 $ hg revert q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
110 file not managed: q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
111 $ rm q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
112
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
113 revert on file that does not exists
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
114 -----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
115
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
116 $ hg revert notfound
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
117 notfound: no such file in rev 334a9e57682c
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
118 $ touch d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
119 $ hg add d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
120 $ hg rm a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
121 $ hg commit -m "second"
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
122 $ echo z > z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
123 $ hg add z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
124 $ hg st
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
125 A z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
126 ? e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
127
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
128 revert to another revision (--rev)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
129 ----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
130
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
131 $ hg revert --all -r0
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
132 forgetting z
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
133 removing d
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
134 adding a
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
135
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
136 revert explicitly to parent (--rev)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
137 -----------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
138
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
139 $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
140 forgetting a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
141 undeleting d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
142 $ rm a *.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
143
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
144 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
145 --------------------------------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
146
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
147 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
148
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
149 $ hg revert -r0 a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
150 $ hg st a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
151 A a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
152 $ hg rm d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
153 $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
154 R d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
155
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
156 should keep d removed
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
157
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
158 $ 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
159 no changes needed to d
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
160 $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
161 R d
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
162
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
163 $ hg update -C
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
164 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
165
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
166 revert of exec bit
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
167 ------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
168
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
169 #if execbit
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 non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
175 non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
176
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
177 $ chmod +x c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
178 $ hg commit -m exe
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
179
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
180 $ chmod -x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
181 $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
182 reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
183
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
184 $ test -x c && echo executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
185 executable
16886
8c1cf3e3fe42 test-revert: enable for Windows
Adrian Buehlmann <adrian@cadifra.com>
parents: 15521
diff changeset
186 #endif
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
187
25753
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
188 Test that files reverted to other than the parent are treated as
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
189 "modified", even if none of mode, size and timestamp of it isn't
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
190 changed on the filesystem (see also issue4583).
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
191
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
192 $ echo 321 > e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
193 $ hg diff --git
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
194 diff --git a/e b/e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
195 --- a/e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
196 +++ b/e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
197 @@ -1,1 +1,1 @@
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
198 -123
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
199 +321
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
200 $ hg commit -m 'ambiguity from size'
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
201
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
202 $ cat e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
203 321
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
204 $ touch -t 200001010000 e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
205 $ hg debugrebuildstate
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
206
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
207 $ cat >> .hg/hgrc <<EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
208 > [fakedirstatewritetime]
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
209 > # emulate invoking dirstate.write() via repo.status()
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
210 > # at 2000-01-01 00:00
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
211 > fakenow = 200001010000
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
212 >
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
213 > [extensions]
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
214 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
215 > EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
216 $ hg revert -r 0 e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
217 $ cat >> .hg/hgrc <<EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
218 > [extensions]
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
219 > fakedirstatewritetime = !
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
220 > EOF
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
221
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
222 $ cat e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
223 123
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
224 $ touch -t 200001010000 e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
225 $ hg status -A e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
226 M e
fe03f522dda9 context: write dirstate out explicitly after marking files as clean
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25382
diff changeset
227
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
228 $ cd ..
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
229
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
230
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
231 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
232 --------------------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
233
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
234 $ hg init a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
235 $ cd a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
236 $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
237 $ hg commit -A -d '1 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
238 adding a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
239 $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
240 $ hg commit -d '2 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
241 $ hg update 0
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
242 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
243 $ mkdir b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
244 $ echo b > b/b
2272
e9a0ed9ed4d9 revert: fix corner case found by faheem mitha.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2157
diff changeset
245
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
246 call `hg revert` with no file specified
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
247 ---------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
248
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
249 $ 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
250 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
251 (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
252 [255]
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
253
24841
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
254 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
255 ---------------------------
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
256
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
257 $ 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
258 $ 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
259 reverting a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
260
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
261 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
262 ---------------------------
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
263
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
264 $ 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
265 $ 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
266 reverting a
45bd336e3991 revert: accept just -I/-X without paths or -a/-i (issue4592)
Martin von Zweigbergk <martinvonz@google.com>
parents: 23730
diff changeset
267
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
268 call `hg revert` with --all
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
269 ---------------------------
12106
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 $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
272 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
273 $ rm *.orig
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
274
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
275 Issue332: confusing message when reverting directory
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
276 ----------------------------------------------------
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
277
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
278 $ hg ci -A -m b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
279 adding b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
280 created new head
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
281 $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
282 $ mkdir newdir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
283 $ echo foo > newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
284 $ hg add newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
285 $ hg revert b newdir
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
286 forgetting newdir/newfile
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
287 reverting b/b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
288 $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
289 $ hg revert .
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
290 reverting b/b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
291
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
292
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
293 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
294 --------------------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
295
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
296 $ hg mv a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
297 $ hg revert newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
298 $ hg st a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
299 ? newa
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
300
23403
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
301 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
302
edf29f9c15f0 revert: look for copy information for all local modifications
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22611
diff changeset
303 $ 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
304 $ 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
305 $ 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
306
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
307 $ 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
308
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
309 $ hg init ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
310 $ cd ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
311 $ echo '^ignored$' > .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
312 $ echo '^ignoreddir$' >> .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
313 $ 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
314
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
315 $ mkdir ignoreddir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
316 $ touch ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
317 $ touch ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
318 $ touch ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
319 $ touch removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
320
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
321 4 ignored files (we will add/commit everything)
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
322
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
323 $ hg st -A -X .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
324 I ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
325 I ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
326 I ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
327 I removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
328 $ 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
329
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
330 $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
331 $ echo >> ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
332 $ hg rm removed ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
333
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
334 should revert ignored* and undelete *removed
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
335 --------------------------------------------
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
336
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
337 $ hg revert -a --no-backup
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
338 reverting ignored
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
339 reverting ignoreddir/file
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34146
diff changeset
340 undeleting ignoreddir/removed
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
341 undeleting removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
342 $ hg st -mardi
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
343
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
344 $ hg up -qC
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
345 $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
346 $ hg rm removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
347
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
348 should silently revert the named files
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
349 --------------------------------------
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
350
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
351 $ hg revert --no-backup ignored removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
352 $ hg st -mardi
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16886
diff changeset
353
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
354 Reverting copy (issue3920)
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
355 --------------------------
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
356
19129
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
357 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
358
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
359 $ rm .hgignore
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
360 $ hg update -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
361 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
362 $ hg mv ignored allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
363 $ hg copy removed base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
364 $ hg commit -m rename
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
365
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
366 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
367
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
368 $ hg update '.^'
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
369 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
370 $ hg revert -rtip -a
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
371 removing ignored
19129
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
372 adding allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
373 adding base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
374 $ hg status -C
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
375 A allyour
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
376 ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
377 A base
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
378 removed
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
379 R ignored
bd19587a3347 revert: ensure that copies and renames are honored (issue3920)
Bryan O'Sullivan <bryano@fb.com>
parents: 16913
diff changeset
380
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
381 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
382 ====================================================
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
383
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
384 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
385
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
386 $ 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
387 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
388 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
389 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
390 $ 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
391
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
392 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
393
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
394 $ 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
395 $ 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
396 $ 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
397 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
398
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
399
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
400 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
401
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 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
403 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
404 (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
405 $ 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
406 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
407 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
408 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
409 rename
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
410 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
411 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
412 update: (current)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25111
diff changeset
413 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
414
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
415 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
416
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
417 $ 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
418 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
419 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
420 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
421 $ 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
422 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
423 $ 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
424 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
425 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
426 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
427
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
428 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
429 -----------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
430
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
431 $ 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
432 $ 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
433 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
434 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
435 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
436
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
437 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
438 ------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
439
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
440 $ 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
441 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
442 $ 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
443 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
444 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
445 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
446 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
447
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
448 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
449 ------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
450
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
451 $ 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
452 $ 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
453 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
454 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
455 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
456 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
457
22099
9ed5e1053303 test-revert: improve comment
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21579
diff changeset
458 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
459 ------------------------------------------
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
460
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
461 $ 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
462 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
463 $ 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
464 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
465 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
466 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
467 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
468
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
469 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
470 =====================================================
21573
4af19d39706e revert: add a test case to reverting "add" during merges
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 19129
diff changeset
471
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
472 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
473 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
474 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
475 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
476
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
477 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
478 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
479 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
480 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
481
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
482 - a "base" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
483 - a "parent" revision
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
484 - 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
485
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
486 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
487
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
488 <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
489
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
490 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
491 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
492
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
493 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
494 -------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
495
22127
3163b8f8ff26 test-revert: display the list of all generated cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22126
diff changeset
496 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
497
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
498 $ "$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
499 content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
500 content1_content1_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
501 content1_content1_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
502 content1_content1_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
503 content1_content1_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
504 content1_content1_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
505 content1_content2_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
506 content1_content2_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
507 content1_content2_content2-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
508 content1_content2_content2-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
509 content1_content2_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
510 content1_content2_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
511 content1_content2_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
512 content1_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
513 content1_missing_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
514 content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
515 content1_missing_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
516 content1_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
517 content1_missing_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
518 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
519 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
520 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
521 missing_content2_content3-tracked
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
522 missing_content2_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
523 missing_content2_missing-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
524 missing_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
525 missing_missing_content3-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
526 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
527 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
528 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
529
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
530 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
531 ---------------------------------------------------
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
532
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
533 $ 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
534 > # generate a simple text view of the directory for easy comparison
39740
e0a7cfa9323f py3: use print as a function in tests/test-revert.t
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39707
diff changeset
535 > from __future__ import print_function
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
536 > 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
537 > 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
538 > 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
539 > 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
540 > 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
541 > continue
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
542 > content = open(filename).read()
39740
e0a7cfa9323f py3: use print as a function in tests/test-revert.t
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39707
diff changeset
543 > print('%-6s %s' % (content.strip(), filename))
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
544 > EOF
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
545
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
546 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
547 -------------------------------
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
548
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
549 $ 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
550 $ cd revert-ref
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
551
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
552 Generate base changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
553
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
554 $ "$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
555 $ 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
556 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
557 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
558 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
559 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
560 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
561 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
562 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
563 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
564 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
565 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
566 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
567 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
568 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
569 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
570 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
571 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
572 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
573 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
574 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
575 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
576 $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
577 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
578 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
579 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
580 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
581 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
582 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
583 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
584 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
585 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
586 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
587 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
588 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
589 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
590 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
591 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
592 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
593 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
594 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
595 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
596 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
597 $ 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
598
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
599 (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
600
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
601 $ "$PYTHON" ../dircontent.py > ../content-base.txt
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
602 $ 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
603 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
604 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
605 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
606 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
607 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
608 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
609 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
610 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
611 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
612 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
613 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
614 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
615 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
616 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
617 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
618 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
619 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
620 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
621 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
622 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
623
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
624 Create parent changeset
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
625
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
626 $ "$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
627 $ 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
628 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
629 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
630 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
631 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
632 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
633 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
634 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
635 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
636 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
637 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
638 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
639 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
640 $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
641 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
642 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
643 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
644 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
645 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
646 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
647 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
648 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
649 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
650 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
651 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
652 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
653 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
654 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
655 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
656 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
657 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
658 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
659 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
660 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
661 $ 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
662
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
663 (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
664
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
665 $ "$PYTHON" ../dircontent.py > ../content-parent.txt
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
666 $ 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
667 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
668 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
669 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
670 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
671 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
672 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
673 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
674 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
675 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
676 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
677 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
678 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
679 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
680 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
681 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
682 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
683 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
684 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
685 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
686 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
687
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
688 Setup working directory
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
689
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
690 $ "$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
691 $ 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
692 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
693 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
694 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
695 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
696 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
697 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
698 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
699 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
700 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
701 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
702 $ hg forget *_*_*-untracked
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
703 $ rm *_*_missing-*
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
704 $ hg status
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
705 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
706 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
707 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
708 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
709 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
710 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
711 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
712 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
713 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
714 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
715 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
716 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
717 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
718 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
719 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
720 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
721 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
722 ! 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
723 ! 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
724 ! 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
725 ! 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
726 ! 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
727 ? 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
728 ? 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
729 ? 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
730
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
731 $ 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
732 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
733 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
734 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
735 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
736 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
737 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
738 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
739 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
740 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
741 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
742 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
743 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
744 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
745 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
746 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
747 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
748 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
749 ! 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
750 ! 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
751 ! 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
752 ! 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
753 ! 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
754 ? 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
755
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
756 (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
757
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
758 $ "$PYTHON" ../dircontent.py > ../content-wc.txt
22126
651b2149f1e7 test-revert: also create a text version of the snapshot
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22124
diff changeset
759 $ 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
760 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
761 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
762 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
763 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
764 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
765 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
766 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
767 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
768 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
769 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
770 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
771 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
772 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
773 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
774 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
775 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
776 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
777 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
778 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
779 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
780
22124
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
781 $ cd ..
e51784473fc0 test-revert: prepare methodical testing of revert cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22123
diff changeset
782
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
783 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
784 -----------------------------------
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
785
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
786 (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
787
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
788 $ cp -R revert-ref revert-parent-all
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
789 $ 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
790
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
791 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
792
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
793 $ 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
794 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
795 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
796 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
797 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
798 forgetting missing_missing_missing-tracked
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
799 reverting content1_content1_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
800 reverting content1_content1_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
801 reverting content1_content2_content1-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
802 reverting content1_content2_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
803 reverting content1_content2_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
804 reverting missing_content2_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
805 reverting missing_content2_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
806 undeleting content1_content1_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
807 undeleting content1_content1_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
808 undeleting content1_content1_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
809 undeleting content1_content2_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
810 undeleting content1_content2_content2-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
811 undeleting content1_content2_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
812 undeleting content1_content2_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
813 undeleting missing_content2_content2-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
814 undeleting missing_content2_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
815 undeleting missing_content2_missing-untracked
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
816
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
817 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
818
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
819 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
820 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
821
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
822 $ "$PYTHON" ../dircontent.py > ../content-parent-all.txt
22128
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
823 $ cd ..
db23fb4e210d test-revert: add methodical revert to parent for working directory
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22127
diff changeset
824 $ 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
825 +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
826 +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
827 +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
828 +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
829 +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
830 +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
831 +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
832 +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
833 +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
834 +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
835 +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
836 +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
837 +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
838 +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
839
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
840 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
841 -----------------------------------
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
842
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
843 (setup from reference repo)
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
844
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
845 $ cp -R revert-ref revert-base-all
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
846 $ cd revert-base-all
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
847
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
848 check revert output
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
849
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
850 $ hg revert --all --rev 'desc(base)'
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
851 forgetting missing_missing_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
852 forgetting missing_missing_missing-tracked
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
853 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
854 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
855 removing missing_content2_missing-tracked
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
856 reverting content1_content1_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
857 reverting content1_content1_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
858 reverting content1_content2_content2-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
859 reverting content1_content2_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
860 reverting content1_content2_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
861 reverting content1_missing_content3-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
862 reverting content1_missing_missing-tracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
863 adding content1_missing_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
864 adding content1_missing_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
865 adding content1_missing_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
866 undeleting content1_content1_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
867 undeleting content1_content1_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
868 undeleting content1_content1_missing-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
869 undeleting content1_content2_content1-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
870 undeleting content1_content2_content2-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
871 undeleting content1_content2_content3-untracked
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
872 undeleting content1_content2_missing-untracked
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
873
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
874 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
875
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
876 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
877 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
878
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
879 $ "$PYTHON" ../dircontent.py > ../content-base-all.txt
22129
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
880 $ cd ..
f0147ff1109f test-revert: add methodical revert to "base"
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22128
diff changeset
881 $ 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
882 +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
883 +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
884 +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
885 +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
886 +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
887 +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
888 +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
889 +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
890 +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
891 +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
892 +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
893 +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
894
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
895 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
896 -----------------------------------------------------
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
897
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
898 (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
899
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
900 $ cp -R revert-ref revert-parent-explicit
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
901 $ 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
902
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
903 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
904 (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
905
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
906 $ 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
907 > 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
908 > 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
909 > echo
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
910 > done
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
911 ### revert for: content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
912 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
913
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
914 ### 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
915
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
916 ### 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
917
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
918 ### 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
919
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
920 ### 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
921
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
922 ### 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
923
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
924 ### 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
925
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
926 ### 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
927
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
928 ### revert for: content1_content2_content2-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
929 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
930
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
931 ### 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
932
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
933 ### 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
934
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
935 ### 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
936
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
937 ### 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
938
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
939 ### 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
940
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
941 ### 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
942
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
943 ### revert for: content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
944 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
945
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
946 ### 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
947
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
948 ### revert for: content1_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
949 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
950
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
951 ### 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
952
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
953 ### revert for: content1_missing_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
954 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
955
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
956 ### 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
957 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
958
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
959 ### 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
960
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
961 ### 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
962
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
963 ### 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
964
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
965 ### 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
966
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
967 ### 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
968
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
969 ### 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
970
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
971 ### revert for: missing_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
972 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
973
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
974 ### revert for: missing_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
975
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
976 ### 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
977 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
978
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
979
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
980 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
981 (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
982
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
983 $ "$PYTHON" ../dircontent.py > ../content-parent-explicit.txt
22130
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
984 $ cd ..
78abb9a42830 test-revert: add methodical revert with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22129
diff changeset
985 $ 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
986 [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
987
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
988 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
989 -----------------------------------------------------
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
990
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
991 (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
992
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 28192
diff changeset
993 $ cp -R revert-ref revert-base-explicit
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
994 $ 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
995
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
996 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
997 (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
998
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
999 $ 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
1000 > 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
1001 > 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
1002 > 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
1003 > done
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1004 ### revert for: content1_content1_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1005 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
1006
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1007 ### 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
1008
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1009 ### 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
1010
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1011 ### revert for: content1_content1_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1012
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1013 ### 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
1014
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1015 ### 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
1016
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1017 ### revert for: content1_content2_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1018 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
1019
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1020 ### 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
1021
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1022 ### 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
1023
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1024 ### 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
1025
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1026 ### 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
1027
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1028 ### 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
1029
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1030 ### 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
1031
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1032 ### 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
1033
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1034 ### revert for: content1_missing_content1-tracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1035 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
1036
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1037 ### revert for: content1_missing_content1-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1038
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1039 ### 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
1040
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1041 ### 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
1042
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1043 ### 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
1044
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1045 ### 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
1046
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1047 ### 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
1048
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1049 ### 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
1050 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
1051
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1052 ### 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
1053
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1054 ### 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
1055 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
1056
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1057 ### 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
1058
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1059 ### revert for: missing_content2_missing-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1060 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
1061
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1062 ### 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
1063
23160
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1064 ### revert for: missing_missing_content3-untracked
4f4e6815f286 test-revert: sort by output filename again
Martin von Zweigbergk <martinvonz@google.com>
parents: 23159
diff changeset
1065 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
1066
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1067 ### revert for: missing_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
1068
23159
20d3e2d73432 test-revert: name files by state, not by state transition
Martin von Zweigbergk <martinvonz@google.com>
parents: 23158
diff changeset
1069 ### 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
1070 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
1071
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
1072
23139
e53f6b72a0e4 spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents: 23135
diff changeset
1073 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
1074 (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
1075
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39405
diff changeset
1076 $ "$PYTHON" ../dircontent.py > ../content-base-explicit.txt
22131
8768342af0cd test-revert: add methodical revert to "base" with explicit file path
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 22130
diff changeset
1077 $ 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
1078 $ 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
1079 [1]
28192
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1080
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1081 Revert to an ancestor of P2 during a merge (issue5052)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1082 -----------------------------------------------------
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1083
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1084 (prepare the repository)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1085
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1086 $ hg init issue5052
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1087 $ cd issue5052
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1088 $ echo '.\.orig' > .hgignore
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1089 $ echo 0 > root
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1090 $ hg ci -qAm C0
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1091 $ echo 0 > A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1092 $ hg ci -qAm C1
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1093 $ echo 1 >> A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1094 $ hg ci -qm C2
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1095 $ hg up -q 0
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1096 $ echo 1 > B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1097 $ hg ci -qAm C3
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1098 $ hg status --rev 'ancestor(.,2)' --rev 2
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1099 A A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1100 $ hg log -G -T '{rev} ({files})\n'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1101 @ 3 (B)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1102 |
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1103 | o 2 (A)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1104 | |
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1105 | o 1 (A)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1106 |/
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1107 o 0 (.hgignore root)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1108
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1109
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1110 actual tests: reverting to something else than a merge parent
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1111
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1112 $ hg merge
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1114 (branch merge, don't forget to commit)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1115
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1116 $ hg status --rev 'p1()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1117 M A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1118 $ hg status --rev 'p2()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1119 A B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1120 $ hg status --rev '1'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1121 M A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1122 A B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1123 $ hg revert --rev 1 --all
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
1124 removing B
28192
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1125 reverting A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1126 $ hg status --rev 1
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1127
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1128 From the other parents
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1129
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1130 $ hg up -C 'p2()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1132 $ hg merge
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1134 (branch merge, don't forget to commit)
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1135
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1136 $ hg status --rev 'p1()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1137 M B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1138 $ hg status --rev 'p2()'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1139 A A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1140 $ hg status --rev '1'
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1141 M A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1142 A B
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1143 $ hg revert --rev 1 --all
39405
cb70501d8b71 revert: fix the inconsistency of status msgs in --interactive mode
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
1144 removing B
28192
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1145 reverting A
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1146 $ hg status --rev 1
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1147
cb6a952efbf4 revert: properly revert to ancestor of p2 during merge (issue5052)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26969
diff changeset
1148 $ cd ..