Show More
@@ -1,1194 +1,1156 b'' | |||||
1 | $ hg init repo |
|
1 | $ hg init repo | |
2 | $ cd repo |
|
2 | $ cd repo | |
3 | $ echo 123 > a |
|
3 | $ echo 123 > a | |
4 | $ echo 123 > c |
|
4 | $ echo 123 > c | |
5 | $ echo 123 > e |
|
5 | $ echo 123 > e | |
6 | $ hg add a c e |
|
6 | $ hg add a c e | |
7 | $ hg commit -m "first" a c e |
|
7 | $ hg commit -m "first" a c e | |
8 |
|
8 | |||
9 | nothing changed |
|
9 | nothing changed | |
10 |
|
10 | |||
11 | $ hg revert |
|
11 | $ hg revert | |
12 | abort: no files or directories specified |
|
12 | abort: no files or directories specified | |
13 | (use --all to revert all files) |
|
13 | (use --all to revert all files) | |
14 | [255] |
|
14 | [255] | |
15 | $ hg revert --all |
|
15 | $ hg revert --all | |
16 |
|
16 | |||
17 | Introduce some changes and revert them |
|
17 | Introduce some changes and revert them | |
18 | -------------------------------------- |
|
18 | -------------------------------------- | |
19 |
|
19 | |||
20 | $ echo 123 > b |
|
20 | $ echo 123 > b | |
21 |
|
21 | |||
22 | $ hg status |
|
22 | $ hg status | |
23 | ? b |
|
23 | ? b | |
24 | $ echo 12 > c |
|
24 | $ echo 12 > c | |
25 |
|
25 | |||
26 | $ hg status |
|
26 | $ hg status | |
27 | M c |
|
27 | M c | |
28 | ? b |
|
28 | ? b | |
29 | $ hg add b |
|
29 | $ hg add b | |
30 |
|
30 | |||
31 | $ hg status |
|
31 | $ hg status | |
32 | M c |
|
32 | M c | |
33 | A b |
|
33 | A b | |
34 | $ hg rm a |
|
34 | $ hg rm a | |
35 |
|
35 | |||
36 | $ hg status |
|
36 | $ hg status | |
37 | M c |
|
37 | M c | |
38 | A b |
|
38 | A b | |
39 | R a |
|
39 | R a | |
40 |
|
40 | |||
41 | revert removal of a file |
|
41 | revert removal of a file | |
42 |
|
42 | |||
43 | $ hg revert a |
|
43 | $ hg revert a | |
44 | $ hg status |
|
44 | $ hg status | |
45 | M c |
|
45 | M c | |
46 | A b |
|
46 | A b | |
47 |
|
47 | |||
48 | revert addition of a file |
|
48 | revert addition of a file | |
49 |
|
49 | |||
50 | $ hg revert b |
|
50 | $ hg revert b | |
51 | $ hg status |
|
51 | $ hg status | |
52 | M c |
|
52 | M c | |
53 | ? b |
|
53 | ? b | |
54 |
|
54 | |||
55 | revert modification of a file (--no-backup) |
|
55 | revert modification of a file (--no-backup) | |
56 |
|
56 | |||
57 | $ hg revert --no-backup c |
|
57 | $ hg revert --no-backup c | |
58 | $ hg status |
|
58 | $ hg status | |
59 | ? b |
|
59 | ? b | |
60 |
|
60 | |||
61 | revert deletion (! status) of a added file |
|
61 | revert deletion (! status) of a added file | |
62 | ------------------------------------------ |
|
62 | ------------------------------------------ | |
63 |
|
63 | |||
64 | $ hg add b |
|
64 | $ hg add b | |
65 |
|
65 | |||
66 | $ hg status b |
|
66 | $ hg status b | |
67 | A b |
|
67 | A b | |
68 | $ rm b |
|
68 | $ rm b | |
69 | $ hg status b |
|
69 | $ hg status b | |
70 | ! b |
|
70 | ! b | |
71 | $ hg revert -v b |
|
71 | $ hg revert -v b | |
72 | forgetting b |
|
72 | forgetting b | |
73 | $ hg status b |
|
73 | $ hg status b | |
74 | b: * (glob) |
|
74 | b: * (glob) | |
75 |
|
75 | |||
76 | $ ls |
|
76 | $ ls | |
77 | a |
|
77 | a | |
78 | c |
|
78 | c | |
79 | e |
|
79 | e | |
80 |
|
80 | |||
81 | Test creation of backup (.orig) files |
|
81 | Test creation of backup (.orig) files | |
82 | ------------------------------------- |
|
82 | ------------------------------------- | |
83 |
|
83 | |||
84 | $ echo z > e |
|
84 | $ echo z > e | |
85 | $ hg revert --all -v |
|
85 | $ hg revert --all -v | |
86 | saving current version of e as e.orig |
|
86 | saving current version of e as e.orig | |
87 | reverting e |
|
87 | reverting e | |
88 |
|
88 | |||
89 | revert on clean file (no change) |
|
89 | revert on clean file (no change) | |
90 | -------------------------------- |
|
90 | -------------------------------- | |
91 |
|
91 | |||
92 | $ hg revert a |
|
92 | $ hg revert a | |
93 | no changes needed to a |
|
93 | no changes needed to a | |
94 |
|
94 | |||
95 | revert on an untracked file |
|
95 | revert on an untracked file | |
96 | --------------------------- |
|
96 | --------------------------- | |
97 |
|
97 | |||
98 | $ echo q > q |
|
98 | $ echo q > q | |
99 | $ hg revert q |
|
99 | $ hg revert q | |
100 | file not managed: q |
|
100 | file not managed: q | |
101 | $ rm q |
|
101 | $ rm q | |
102 |
|
102 | |||
103 | revert on file that does not exists |
|
103 | revert on file that does not exists | |
104 | ----------------------------------- |
|
104 | ----------------------------------- | |
105 |
|
105 | |||
106 | $ hg revert notfound |
|
106 | $ hg revert notfound | |
107 | notfound: no such file in rev 334a9e57682c |
|
107 | notfound: no such file in rev 334a9e57682c | |
108 | $ touch d |
|
108 | $ touch d | |
109 | $ hg add d |
|
109 | $ hg add d | |
110 | $ hg rm a |
|
110 | $ hg rm a | |
111 | $ hg commit -m "second" |
|
111 | $ hg commit -m "second" | |
112 | $ echo z > z |
|
112 | $ echo z > z | |
113 | $ hg add z |
|
113 | $ hg add z | |
114 | $ hg st |
|
114 | $ hg st | |
115 | A z |
|
115 | A z | |
116 | ? e.orig |
|
116 | ? e.orig | |
117 |
|
117 | |||
118 | revert to another revision (--rev) |
|
118 | revert to another revision (--rev) | |
119 | ---------------------------------- |
|
119 | ---------------------------------- | |
120 |
|
120 | |||
121 | $ hg revert --all -r0 |
|
121 | $ hg revert --all -r0 | |
122 | adding a |
|
122 | adding a | |
123 | removing d |
|
123 | removing d | |
124 | forgetting z |
|
124 | forgetting z | |
125 |
|
125 | |||
126 | revert explicitly to parent (--rev) |
|
126 | revert explicitly to parent (--rev) | |
127 | ----------------------------------- |
|
127 | ----------------------------------- | |
128 |
|
128 | |||
129 | $ hg revert --all -rtip |
|
129 | $ hg revert --all -rtip | |
130 | forgetting a |
|
130 | forgetting a | |
131 | undeleting d |
|
131 | undeleting d | |
132 | $ rm a *.orig |
|
132 | $ rm a *.orig | |
133 |
|
133 | |||
134 | revert to another revision (--rev) and exact match |
|
134 | revert to another revision (--rev) and exact match | |
135 | -------------------------------------------------- |
|
135 | -------------------------------------------------- | |
136 |
|
136 | |||
137 | exact match are more silent |
|
137 | exact match are more silent | |
138 |
|
138 | |||
139 | $ hg revert -r0 a |
|
139 | $ hg revert -r0 a | |
140 | $ hg st a |
|
140 | $ hg st a | |
141 | A a |
|
141 | A a | |
142 | $ hg rm d |
|
142 | $ hg rm d | |
143 | $ hg st d |
|
143 | $ hg st d | |
144 | R d |
|
144 | R d | |
145 |
|
145 | |||
146 | should keep d removed |
|
146 | should keep d removed | |
147 |
|
147 | |||
148 | $ hg revert -r0 d |
|
148 | $ hg revert -r0 d | |
149 | no changes needed to d |
|
149 | no changes needed to d | |
150 | $ hg st d |
|
150 | $ hg st d | |
151 | R d |
|
151 | R d | |
152 |
|
152 | |||
153 | $ hg update -C |
|
153 | $ hg update -C | |
154 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
154 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
155 |
|
155 | |||
156 | revert of exec bit |
|
156 | revert of exec bit | |
157 | ------------------ |
|
157 | ------------------ | |
158 |
|
158 | |||
159 | #if execbit |
|
159 | #if execbit | |
160 | $ chmod +x c |
|
160 | $ chmod +x c | |
161 | $ hg revert --all |
|
161 | $ hg revert --all | |
162 | reverting c |
|
162 | reverting c | |
163 |
|
163 | |||
164 | $ test -x c || echo non-executable |
|
164 | $ test -x c || echo non-executable | |
165 | non-executable |
|
165 | non-executable | |
166 |
|
166 | |||
167 | $ chmod +x c |
|
167 | $ chmod +x c | |
168 | $ hg commit -m exe |
|
168 | $ hg commit -m exe | |
169 |
|
169 | |||
170 | $ chmod -x c |
|
170 | $ chmod -x c | |
171 | $ hg revert --all |
|
171 | $ hg revert --all | |
172 | reverting c |
|
172 | reverting c | |
173 |
|
173 | |||
174 | $ test -x c && echo executable |
|
174 | $ test -x c && echo executable | |
175 | executable |
|
175 | executable | |
176 | #endif |
|
176 | #endif | |
177 |
|
177 | |||
178 | $ cd .. |
|
178 | $ cd .. | |
179 |
|
179 | |||
180 |
|
180 | |||
181 | Issue241: update and revert produces inconsistent repositories |
|
181 | Issue241: update and revert produces inconsistent repositories | |
182 | -------------------------------------------------------------- |
|
182 | -------------------------------------------------------------- | |
183 |
|
183 | |||
184 | $ hg init a |
|
184 | $ hg init a | |
185 | $ cd a |
|
185 | $ cd a | |
186 | $ echo a >> a |
|
186 | $ echo a >> a | |
187 | $ hg commit -A -d '1 0' -m a |
|
187 | $ hg commit -A -d '1 0' -m a | |
188 | adding a |
|
188 | adding a | |
189 | $ echo a >> a |
|
189 | $ echo a >> a | |
190 | $ hg commit -d '2 0' -m a |
|
190 | $ hg commit -d '2 0' -m a | |
191 | $ hg update 0 |
|
191 | $ hg update 0 | |
192 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
192 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
193 | $ mkdir b |
|
193 | $ mkdir b | |
194 | $ echo b > b/b |
|
194 | $ echo b > b/b | |
195 |
|
195 | |||
196 | call `hg revert` with no file specified |
|
196 | call `hg revert` with no file specified | |
197 | --------------------------------------- |
|
197 | --------------------------------------- | |
198 |
|
198 | |||
199 | $ hg revert -rtip |
|
199 | $ hg revert -rtip | |
200 | abort: no files or directories specified |
|
200 | abort: no files or directories specified | |
201 | (use --all to revert all files, or 'hg update 1' to update) |
|
201 | (use --all to revert all files, or 'hg update 1' to update) | |
202 | [255] |
|
202 | [255] | |
203 |
|
203 | |||
204 | call `hg revert` with --all |
|
204 | call `hg revert` with --all | |
205 | --------------------------- |
|
205 | --------------------------- | |
206 |
|
206 | |||
207 | $ hg revert --all -rtip |
|
207 | $ hg revert --all -rtip | |
208 | reverting a |
|
208 | reverting a | |
209 |
|
209 | |||
210 |
|
210 | |||
211 | Issue332: confusing message when reverting directory |
|
211 | Issue332: confusing message when reverting directory | |
212 | ---------------------------------------------------- |
|
212 | ---------------------------------------------------- | |
213 |
|
213 | |||
214 | $ hg ci -A -m b |
|
214 | $ hg ci -A -m b | |
215 | adding b/b |
|
215 | adding b/b | |
216 | created new head |
|
216 | created new head | |
217 | $ echo foobar > b/b |
|
217 | $ echo foobar > b/b | |
218 | $ mkdir newdir |
|
218 | $ mkdir newdir | |
219 | $ echo foo > newdir/newfile |
|
219 | $ echo foo > newdir/newfile | |
220 | $ hg add newdir/newfile |
|
220 | $ hg add newdir/newfile | |
221 | $ hg revert b newdir |
|
221 | $ hg revert b newdir | |
222 | reverting b/b (glob) |
|
222 | reverting b/b (glob) | |
223 | forgetting newdir/newfile (glob) |
|
223 | forgetting newdir/newfile (glob) | |
224 | $ echo foobar > b/b |
|
224 | $ echo foobar > b/b | |
225 | $ hg revert . |
|
225 | $ hg revert . | |
226 | reverting b/b (glob) |
|
226 | reverting b/b (glob) | |
227 |
|
227 | |||
228 |
|
228 | |||
229 | reverting a rename target should revert the source |
|
229 | reverting a rename target should revert the source | |
230 | -------------------------------------------------- |
|
230 | -------------------------------------------------- | |
231 |
|
231 | |||
232 | $ hg mv a newa |
|
232 | $ hg mv a newa | |
233 | $ hg revert newa |
|
233 | $ hg revert newa | |
234 | $ hg st a newa |
|
234 | $ hg st a newa | |
235 | ? newa |
|
235 | ? newa | |
236 |
|
236 | |||
237 | $ cd .. |
|
237 | $ cd .. | |
238 |
|
238 | |||
239 | $ hg init ignored |
|
239 | $ hg init ignored | |
240 | $ cd ignored |
|
240 | $ cd ignored | |
241 | $ echo '^ignored$' > .hgignore |
|
241 | $ echo '^ignored$' > .hgignore | |
242 | $ echo '^ignoreddir$' >> .hgignore |
|
242 | $ echo '^ignoreddir$' >> .hgignore | |
243 | $ echo '^removed$' >> .hgignore |
|
243 | $ echo '^removed$' >> .hgignore | |
244 |
|
244 | |||
245 | $ mkdir ignoreddir |
|
245 | $ mkdir ignoreddir | |
246 | $ touch ignoreddir/file |
|
246 | $ touch ignoreddir/file | |
247 | $ touch ignoreddir/removed |
|
247 | $ touch ignoreddir/removed | |
248 | $ touch ignored |
|
248 | $ touch ignored | |
249 | $ touch removed |
|
249 | $ touch removed | |
250 |
|
250 | |||
251 | 4 ignored files (we will add/commit everything) |
|
251 | 4 ignored files (we will add/commit everything) | |
252 |
|
252 | |||
253 | $ hg st -A -X .hgignore |
|
253 | $ hg st -A -X .hgignore | |
254 | I ignored |
|
254 | I ignored | |
255 | I ignoreddir/file |
|
255 | I ignoreddir/file | |
256 | I ignoreddir/removed |
|
256 | I ignoreddir/removed | |
257 | I removed |
|
257 | I removed | |
258 | $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed |
|
258 | $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed | |
259 |
|
259 | |||
260 | $ echo >> ignored |
|
260 | $ echo >> ignored | |
261 | $ echo >> ignoreddir/file |
|
261 | $ echo >> ignoreddir/file | |
262 | $ hg rm removed ignoreddir/removed |
|
262 | $ hg rm removed ignoreddir/removed | |
263 |
|
263 | |||
264 | should revert ignored* and undelete *removed |
|
264 | should revert ignored* and undelete *removed | |
265 | -------------------------------------------- |
|
265 | -------------------------------------------- | |
266 |
|
266 | |||
267 | $ hg revert -a --no-backup |
|
267 | $ hg revert -a --no-backup | |
268 | reverting ignored |
|
268 | reverting ignored | |
269 | reverting ignoreddir/file (glob) |
|
269 | reverting ignoreddir/file (glob) | |
270 | undeleting ignoreddir/removed (glob) |
|
270 | undeleting ignoreddir/removed (glob) | |
271 | undeleting removed |
|
271 | undeleting removed | |
272 | $ hg st -mardi |
|
272 | $ hg st -mardi | |
273 |
|
273 | |||
274 | $ hg up -qC |
|
274 | $ hg up -qC | |
275 | $ echo >> ignored |
|
275 | $ echo >> ignored | |
276 | $ hg rm removed |
|
276 | $ hg rm removed | |
277 |
|
277 | |||
278 | should silently revert the named files |
|
278 | should silently revert the named files | |
279 | -------------------------------------- |
|
279 | -------------------------------------- | |
280 |
|
280 | |||
281 | $ hg revert --no-backup ignored removed |
|
281 | $ hg revert --no-backup ignored removed | |
282 | $ hg st -mardi |
|
282 | $ hg st -mardi | |
283 |
|
283 | |||
284 | Reverting copy (issue3920) |
|
284 | Reverting copy (issue3920) | |
285 | -------------------------- |
|
285 | -------------------------- | |
286 |
|
286 | |||
287 | someone set up us the copies |
|
287 | someone set up us the copies | |
288 |
|
288 | |||
289 | $ rm .hgignore |
|
289 | $ rm .hgignore | |
290 | $ hg update -C |
|
290 | $ hg update -C | |
291 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
291 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
292 | $ hg mv ignored allyour |
|
292 | $ hg mv ignored allyour | |
293 | $ hg copy removed base |
|
293 | $ hg copy removed base | |
294 | $ hg commit -m rename |
|
294 | $ hg commit -m rename | |
295 |
|
295 | |||
296 | copies and renames, you have no chance to survive make your time (issue3920) |
|
296 | copies and renames, you have no chance to survive make your time (issue3920) | |
297 |
|
297 | |||
298 | $ hg update '.^' |
|
298 | $ hg update '.^' | |
299 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
299 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
300 | $ hg revert -rtip -a |
|
300 | $ hg revert -rtip -a | |
301 | adding allyour |
|
301 | adding allyour | |
302 | adding base |
|
302 | adding base | |
303 | removing ignored |
|
303 | removing ignored | |
304 | $ hg status -C |
|
304 | $ hg status -C | |
305 | A allyour |
|
305 | A allyour | |
306 | ignored |
|
306 | ignored | |
307 | A base |
|
307 | A base | |
308 | removed |
|
308 | removed | |
309 | R ignored |
|
309 | R ignored | |
310 |
|
310 | |||
311 | Test revert of a file added by one side of the merge |
|
311 | Test revert of a file added by one side of the merge | |
312 | ==================================================== |
|
312 | ==================================================== | |
313 |
|
313 | |||
314 | remove any pending change |
|
314 | remove any pending change | |
315 |
|
315 | |||
316 | $ hg revert --all |
|
316 | $ hg revert --all | |
317 | forgetting allyour |
|
317 | forgetting allyour | |
318 | forgetting base |
|
318 | forgetting base | |
319 | undeleting ignored |
|
319 | undeleting ignored | |
320 | $ hg purge --all --config extensions.purge= |
|
320 | $ hg purge --all --config extensions.purge= | |
321 |
|
321 | |||
322 | Adds a new commit |
|
322 | Adds a new commit | |
323 |
|
323 | |||
324 | $ echo foo > newadd |
|
324 | $ echo foo > newadd | |
325 | $ hg add newadd |
|
325 | $ hg add newadd | |
326 | $ hg commit -m 'other adds' |
|
326 | $ hg commit -m 'other adds' | |
327 | created new head |
|
327 | created new head | |
328 |
|
328 | |||
329 |
|
329 | |||
330 | merge it with the other head |
|
330 | merge it with the other head | |
331 |
|
331 | |||
332 | $ hg merge # merge 1 into 2 |
|
332 | $ hg merge # merge 1 into 2 | |
333 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
333 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
334 | (branch merge, don't forget to commit) |
|
334 | (branch merge, don't forget to commit) | |
335 | $ hg summary |
|
335 | $ hg summary | |
336 | parent: 2:b8ec310b2d4e tip |
|
336 | parent: 2:b8ec310b2d4e tip | |
337 | other adds |
|
337 | other adds | |
338 | parent: 1:f6180deb8fbe |
|
338 | parent: 1:f6180deb8fbe | |
339 | rename |
|
339 | rename | |
340 | branch: default |
|
340 | branch: default | |
341 | commit: 2 modified, 1 removed (merge) |
|
341 | commit: 2 modified, 1 removed (merge) | |
342 | update: (current) |
|
342 | update: (current) | |
343 |
|
343 | |||
344 | clarifies who added what |
|
344 | clarifies who added what | |
345 |
|
345 | |||
346 | $ hg status |
|
346 | $ hg status | |
347 | M allyour |
|
347 | M allyour | |
348 | M base |
|
348 | M base | |
349 | R ignored |
|
349 | R ignored | |
350 | $ hg status --change 'p1()' |
|
350 | $ hg status --change 'p1()' | |
351 | A newadd |
|
351 | A newadd | |
352 | $ hg status --change 'p2()' |
|
352 | $ hg status --change 'p2()' | |
353 | A allyour |
|
353 | A allyour | |
354 | A base |
|
354 | A base | |
355 | R ignored |
|
355 | R ignored | |
356 |
|
356 | |||
357 | revert file added by p1() to p1() state |
|
357 | revert file added by p1() to p1() state | |
358 | ----------------------------------------- |
|
358 | ----------------------------------------- | |
359 |
|
359 | |||
360 | $ hg revert -r 'p1()' 'glob:newad?' |
|
360 | $ hg revert -r 'p1()' 'glob:newad?' | |
361 | $ hg status |
|
361 | $ hg status | |
362 | M allyour |
|
362 | M allyour | |
363 | M base |
|
363 | M base | |
364 | R ignored |
|
364 | R ignored | |
365 |
|
365 | |||
366 | revert file added by p1() to p2() state |
|
366 | revert file added by p1() to p2() state | |
367 | ------------------------------------------ |
|
367 | ------------------------------------------ | |
368 |
|
368 | |||
369 | $ hg revert -r 'p2()' 'glob:newad?' |
|
369 | $ hg revert -r 'p2()' 'glob:newad?' | |
370 | removing newadd |
|
370 | removing newadd | |
371 | $ hg status |
|
371 | $ hg status | |
372 | M allyour |
|
372 | M allyour | |
373 | M base |
|
373 | M base | |
374 | R ignored |
|
374 | R ignored | |
375 | R newadd |
|
375 | R newadd | |
376 |
|
376 | |||
377 | revert file added by p2() to p2() state |
|
377 | revert file added by p2() to p2() state | |
378 | ------------------------------------------ |
|
378 | ------------------------------------------ | |
379 |
|
379 | |||
380 | $ hg revert -r 'p2()' 'glob:allyou?' |
|
380 | $ hg revert -r 'p2()' 'glob:allyou?' | |
381 | $ hg status |
|
381 | $ hg status | |
382 | M allyour |
|
382 | M allyour | |
383 | M base |
|
383 | M base | |
384 | R ignored |
|
384 | R ignored | |
385 | R newadd |
|
385 | R newadd | |
386 |
|
386 | |||
387 | revert file added by p2() to p1() state |
|
387 | revert file added by p2() to p1() state | |
388 | ------------------------------------------ |
|
388 | ------------------------------------------ | |
389 |
|
389 | |||
390 | $ hg revert -r 'p1()' 'glob:allyou?' |
|
390 | $ hg revert -r 'p1()' 'glob:allyou?' | |
391 | removing allyour |
|
391 | removing allyour | |
392 | $ hg status |
|
392 | $ hg status | |
393 | M base |
|
393 | M base | |
394 | R allyour |
|
394 | R allyour | |
395 | R ignored |
|
395 | R ignored | |
396 | R newadd |
|
396 | R newadd | |
397 |
|
397 | |||
398 | Systematic behavior validation of most possible cases |
|
398 | Systematic behavior validation of most possible cases | |
399 | ===================================================== |
|
399 | ===================================================== | |
400 |
|
400 | |||
401 | This section tests most of the possible combinations of working directory |
|
401 | This section tests most of the possible combinations of working directory | |
402 | changes and inter-revision changes. The number of possible cases is significant |
|
402 | changes and inter-revision changes. The number of possible cases is significant | |
403 | but they all have a slightly different handling. So this section commits to |
|
403 | but they all have a slightly different handling. So this section commits to | |
404 | generating and testing all of them to allow safe refactoring of the revert code. |
|
404 | generating and testing all of them to allow safe refactoring of the revert code. | |
405 |
|
405 | |||
406 | A python script is used to generate a file history for each combination of |
|
406 | A python script is used to generate a file history for each combination of | |
407 | changes between, on one side the working directory and its parent and on |
|
407 | changes between, on one side the working directory and its parent and on | |
408 | the other side, changes between a revert target (--rev) and working directory |
|
408 | the other side, changes between a revert target (--rev) and working directory | |
409 | parent. The three states generated are: |
|
409 | parent. The three states generated are: | |
410 |
|
410 | |||
411 | - a "base" revision |
|
411 | - a "base" revision | |
412 | - a "parent" revision |
|
412 | - a "parent" revision | |
413 | - the working directory (based on "parent") |
|
413 | - the working directory (based on "parent") | |
414 |
|
414 | |||
415 | The file generated have names of the form: |
|
415 | The file generated have names of the form: | |
416 |
|
416 | |||
417 | <changeset-state>_<working-copy-state> |
|
417 | <changeset-state>_<working-copy-state> | |
418 |
|
418 | |||
419 | Here, "changeset-state" conveys the state in "base" and "parent" (or the change |
|
419 | Here, "changeset-state" conveys the state in "base" and "parent" (or the change | |
420 | that happen between them), "working-copy-state" is self explanatory. |
|
420 | that happen between them), "working-copy-state" is self explanatory. | |
421 |
|
421 | |||
422 | All known states are not tested yet. See inline documentation for details. |
|
422 | All known states are not tested yet. See inline documentation for details. | |
423 | Special cases from merge and rename are not tested by this section. |
|
423 | Special cases from merge and rename are not tested by this section. | |
424 |
|
424 | |||
425 | Write the python script to disk |
|
425 | Write the python script to disk | |
426 | ------------------------------- |
|
426 | ------------------------------- | |
427 |
|
427 | |||
428 | $ cat << EOF > gen-revert-cases.py |
|
428 | $ cat << EOF > gen-revert-cases.py | |
429 | > # generate proper file state to test revert behavior |
|
429 | > # generate proper file state to test revert behavior | |
430 | > import sys |
|
430 | > import sys | |
431 | > import os |
|
431 | > import os | |
432 | > |
|
432 | > | |
433 | > # content of the file in "base" and "parent" |
|
433 | > # content of the file in "base" and "parent" | |
434 | > # None means no file at all |
|
434 | > # None means no file at all | |
435 | > ctxcontent = { |
|
435 | > ctxcontent = { | |
436 | > # clean: no change from base to parent |
|
436 | > # clean: no change from base to parent | |
437 | > 'clean': ['base', 'base'], |
|
437 | > 'clean': ['base', 'base'], | |
438 | > # modified: file content change from base to parent |
|
438 | > # modified: file content change from base to parent | |
439 | > 'modified': ['base', 'parent'], |
|
439 | > 'modified': ['base', 'parent'], | |
440 | > # added: file is missing from base and added in parent |
|
440 | > # added: file is missing from base and added in parent | |
441 | > 'added': [None, 'parent'], |
|
441 | > 'added': [None, 'parent'], | |
442 | > # removed: file exist in base but is removed from parent |
|
442 | > # removed: file exist in base but is removed from parent | |
443 | > 'removed': ['base', None], |
|
443 | > 'removed': ['base', None], | |
444 | > # file exist neither in base not in parent |
|
444 | > # file exist neither in base not in parent | |
445 | > 'missing': [None, None], |
|
445 | > 'missing': [None, None], | |
446 | > } |
|
446 | > } | |
447 | > |
|
447 | > | |
448 | > # content of file in working copy |
|
448 | > # content of file in working copy | |
449 | > wccontent = { |
|
449 | > wccontent = { | |
450 | > # clean: wc content is the same as parent |
|
450 | > # clean: wc content is the same as parent | |
451 | > 'clean': lambda cc: cc[1], |
|
451 | > 'clean': lambda cc: cc[1], | |
452 | > # revert: wc content is the same as base |
|
452 | > # revert: wc content is the same as base | |
453 | > 'revert': lambda cc: cc[0], |
|
453 | > 'revert': lambda cc: cc[0], | |
454 | > # wc: file exist with a content different from base and parent |
|
454 | > # wc: file exist with a content different from base and parent | |
455 | > 'wc': lambda cc: 'wc', |
|
455 | > 'wc': lambda cc: 'wc', | |
456 | > # removed: file is missing and marked as untracked |
|
456 | > # removed: file is missing and marked as untracked | |
457 | > 'removed': lambda cc: None, |
|
457 | > 'removed': lambda cc: None, | |
458 | > # deleted: file is recorded as tracked but missing |
|
458 | > # deleted: file is recorded as tracked but missing | |
459 | > # rely on file deletion outside of this script |
|
459 | > # rely on file deletion outside of this script | |
460 | > 'deleted': lambda cc:'TOBEDELETED', |
|
460 | > 'deleted': lambda cc:'TOBEDELETED', | |
461 | > } |
|
461 | > } | |
462 | > # untracked-X is a version of X where the file is not tracked (? unknown) |
|
462 | > # untracked-X is a version of X where the file is not tracked (? unknown) | |
463 | > wccontent['untracked-clean'] = wccontent['clean'] |
|
463 | > wccontent['untracked-clean'] = wccontent['clean'] | |
464 | > wccontent['untracked-revert'] = wccontent['revert'] |
|
464 | > wccontent['untracked-revert'] = wccontent['revert'] | |
465 | > wccontent['untracked-wc'] = wccontent['wc'] |
|
465 | > wccontent['untracked-wc'] = wccontent['wc'] | |
466 | > |
|
466 | > | |
467 | > # build the combination of possible states |
|
467 | > # build the combination of possible states | |
468 | > combination = [] |
|
468 | > combination = [] | |
469 | > for ctxkey in ctxcontent: |
|
469 | > for ctxkey, ctxvalue in ctxcontent.iteritems(): | |
470 | > for wckey in wccontent: |
|
470 | > for wckey in wccontent: | |
|
471 | > if (ctxvalue[0] == ctxvalue[1] and 'revert' in wckey): | |||
|
472 | > continue | |||
471 | > filename = "%s_%s" % (ctxkey, wckey) |
|
473 | > filename = "%s_%s" % (ctxkey, wckey) | |
472 | > combination.append((filename, ctxkey, wckey)) |
|
474 | > combination.append((filename, ctxkey, wckey)) | |
473 | > |
|
475 | > | |
474 | > # make sure we have stable output |
|
476 | > # make sure we have stable output | |
475 | > combination.sort() |
|
477 | > combination.sort() | |
476 | > |
|
478 | > | |
477 | > # retrieve the state we must generate |
|
479 | > # retrieve the state we must generate | |
478 | > target = sys.argv[1] |
|
480 | > target = sys.argv[1] | |
479 | > |
|
481 | > | |
480 | > # compute file content |
|
482 | > # compute file content | |
481 | > content = [] |
|
483 | > content = [] | |
482 | > for filename, ctxkey, wckey in combination: |
|
484 | > for filename, ctxkey, wckey in combination: | |
483 | > cc = ctxcontent[ctxkey] |
|
485 | > cc = ctxcontent[ctxkey] | |
484 | > if target == 'filelist': |
|
486 | > if target == 'filelist': | |
485 | > print filename |
|
487 | > print filename | |
486 | > elif target == 'base': |
|
488 | > elif target == 'base': | |
487 | > content.append((filename, cc[0])) |
|
489 | > content.append((filename, cc[0])) | |
488 | > elif target == 'parent': |
|
490 | > elif target == 'parent': | |
489 | > content.append((filename, cc[1])) |
|
491 | > content.append((filename, cc[1])) | |
490 | > elif target == 'wc': |
|
492 | > elif target == 'wc': | |
491 | > content.append((filename, wccontent[wckey](cc))) |
|
493 | > content.append((filename, wccontent[wckey](cc))) | |
492 | > else: |
|
494 | > else: | |
493 | > print >> sys.stderr, "unknown target:", target |
|
495 | > print >> sys.stderr, "unknown target:", target | |
494 | > sys.exit(1) |
|
496 | > sys.exit(1) | |
495 | > |
|
497 | > | |
496 | > # write actual content |
|
498 | > # write actual content | |
497 | > for filename, data in content: |
|
499 | > for filename, data in content: | |
498 | > if data is not None: |
|
500 | > if data is not None: | |
499 | > f = open(filename, 'w') |
|
501 | > f = open(filename, 'w') | |
500 | > f.write(data + '\n') |
|
502 | > f.write(data + '\n') | |
501 | > f.close() |
|
503 | > f.close() | |
502 | > elif os.path.exists(filename): |
|
504 | > elif os.path.exists(filename): | |
503 | > os.remove(filename) |
|
505 | > os.remove(filename) | |
504 | > EOF |
|
506 | > EOF | |
505 |
|
507 | |||
506 | check list of planned files |
|
508 | check list of planned files | |
507 |
|
509 | |||
508 | $ python gen-revert-cases.py filelist |
|
510 | $ python gen-revert-cases.py filelist | |
509 | added_clean |
|
511 | added_clean | |
510 | added_deleted |
|
512 | added_deleted | |
511 | added_removed |
|
513 | added_removed | |
512 | added_revert |
|
514 | added_revert | |
513 | added_untracked-clean |
|
515 | added_untracked-clean | |
514 | added_untracked-revert |
|
516 | added_untracked-revert | |
515 | added_untracked-wc |
|
517 | added_untracked-wc | |
516 | added_wc |
|
518 | added_wc | |
517 | clean_clean |
|
519 | clean_clean | |
518 | clean_deleted |
|
520 | clean_deleted | |
519 | clean_removed |
|
521 | clean_removed | |
520 | clean_revert |
|
|||
521 | clean_untracked-clean |
|
522 | clean_untracked-clean | |
522 | clean_untracked-revert |
|
|||
523 | clean_untracked-wc |
|
523 | clean_untracked-wc | |
524 | clean_wc |
|
524 | clean_wc | |
525 | missing_clean |
|
525 | missing_clean | |
526 | missing_deleted |
|
526 | missing_deleted | |
527 | missing_removed |
|
527 | missing_removed | |
528 | missing_revert |
|
|||
529 | missing_untracked-clean |
|
528 | missing_untracked-clean | |
530 | missing_untracked-revert |
|
|||
531 | missing_untracked-wc |
|
529 | missing_untracked-wc | |
532 | missing_wc |
|
530 | missing_wc | |
533 | modified_clean |
|
531 | modified_clean | |
534 | modified_deleted |
|
532 | modified_deleted | |
535 | modified_removed |
|
533 | modified_removed | |
536 | modified_revert |
|
534 | modified_revert | |
537 | modified_untracked-clean |
|
535 | modified_untracked-clean | |
538 | modified_untracked-revert |
|
536 | modified_untracked-revert | |
539 | modified_untracked-wc |
|
537 | modified_untracked-wc | |
540 | modified_wc |
|
538 | modified_wc | |
541 | removed_clean |
|
539 | removed_clean | |
542 | removed_deleted |
|
540 | removed_deleted | |
543 | removed_removed |
|
541 | removed_removed | |
544 | removed_revert |
|
542 | removed_revert | |
545 | removed_untracked-clean |
|
543 | removed_untracked-clean | |
546 | removed_untracked-revert |
|
544 | removed_untracked-revert | |
547 | removed_untracked-wc |
|
545 | removed_untracked-wc | |
548 | removed_wc |
|
546 | removed_wc | |
549 |
|
547 | |||
550 | Script to make a simple text version of the content |
|
548 | Script to make a simple text version of the content | |
551 | --------------------------------------------------- |
|
549 | --------------------------------------------------- | |
552 |
|
550 | |||
553 | $ cat << EOF >> dircontent.py |
|
551 | $ cat << EOF >> dircontent.py | |
554 | > # generate a simple text view of the directory for easy comparison |
|
552 | > # generate a simple text view of the directory for easy comparison | |
555 | > import os |
|
553 | > import os | |
556 | > files = os.listdir('.') |
|
554 | > files = os.listdir('.') | |
557 | > files.sort() |
|
555 | > files.sort() | |
558 | > for filename in files: |
|
556 | > for filename in files: | |
559 | > if os.path.isdir(filename): |
|
557 | > if os.path.isdir(filename): | |
560 | > continue |
|
558 | > continue | |
561 | > content = open(filename).read() |
|
559 | > content = open(filename).read() | |
562 | > print '%-6s %s' % (content.strip(), filename) |
|
560 | > print '%-6s %s' % (content.strip(), filename) | |
563 | > EOF |
|
561 | > EOF | |
564 |
|
562 | |||
565 | Generate appropriate repo state |
|
563 | Generate appropriate repo state | |
566 | ------------------------------- |
|
564 | ------------------------------- | |
567 |
|
565 | |||
568 | $ hg init revert-ref |
|
566 | $ hg init revert-ref | |
569 | $ cd revert-ref |
|
567 | $ cd revert-ref | |
570 |
|
568 | |||
571 | Generate base changeset |
|
569 | Generate base changeset | |
572 |
|
570 | |||
573 | $ python ../gen-revert-cases.py base |
|
571 | $ python ../gen-revert-cases.py base | |
574 | $ hg addremove --similarity 0 |
|
572 | $ hg addremove --similarity 0 | |
575 | adding clean_clean |
|
573 | adding clean_clean | |
576 | adding clean_deleted |
|
574 | adding clean_deleted | |
577 | adding clean_removed |
|
575 | adding clean_removed | |
578 | adding clean_revert |
|
|||
579 | adding clean_untracked-clean |
|
576 | adding clean_untracked-clean | |
580 | adding clean_untracked-revert |
|
|||
581 | adding clean_untracked-wc |
|
577 | adding clean_untracked-wc | |
582 | adding clean_wc |
|
578 | adding clean_wc | |
583 | adding modified_clean |
|
579 | adding modified_clean | |
584 | adding modified_deleted |
|
580 | adding modified_deleted | |
585 | adding modified_removed |
|
581 | adding modified_removed | |
586 | adding modified_revert |
|
582 | adding modified_revert | |
587 | adding modified_untracked-clean |
|
583 | adding modified_untracked-clean | |
588 | adding modified_untracked-revert |
|
584 | adding modified_untracked-revert | |
589 | adding modified_untracked-wc |
|
585 | adding modified_untracked-wc | |
590 | adding modified_wc |
|
586 | adding modified_wc | |
591 | adding removed_clean |
|
587 | adding removed_clean | |
592 | adding removed_deleted |
|
588 | adding removed_deleted | |
593 | adding removed_removed |
|
589 | adding removed_removed | |
594 | adding removed_revert |
|
590 | adding removed_revert | |
595 | adding removed_untracked-clean |
|
591 | adding removed_untracked-clean | |
596 | adding removed_untracked-revert |
|
592 | adding removed_untracked-revert | |
597 | adding removed_untracked-wc |
|
593 | adding removed_untracked-wc | |
598 | adding removed_wc |
|
594 | adding removed_wc | |
599 | $ hg status |
|
595 | $ hg status | |
600 | A clean_clean |
|
596 | A clean_clean | |
601 | A clean_deleted |
|
597 | A clean_deleted | |
602 | A clean_removed |
|
598 | A clean_removed | |
603 | A clean_revert |
|
|||
604 | A clean_untracked-clean |
|
599 | A clean_untracked-clean | |
605 | A clean_untracked-revert |
|
|||
606 | A clean_untracked-wc |
|
600 | A clean_untracked-wc | |
607 | A clean_wc |
|
601 | A clean_wc | |
608 | A modified_clean |
|
602 | A modified_clean | |
609 | A modified_deleted |
|
603 | A modified_deleted | |
610 | A modified_removed |
|
604 | A modified_removed | |
611 | A modified_revert |
|
605 | A modified_revert | |
612 | A modified_untracked-clean |
|
606 | A modified_untracked-clean | |
613 | A modified_untracked-revert |
|
607 | A modified_untracked-revert | |
614 | A modified_untracked-wc |
|
608 | A modified_untracked-wc | |
615 | A modified_wc |
|
609 | A modified_wc | |
616 | A removed_clean |
|
610 | A removed_clean | |
617 | A removed_deleted |
|
611 | A removed_deleted | |
618 | A removed_removed |
|
612 | A removed_removed | |
619 | A removed_revert |
|
613 | A removed_revert | |
620 | A removed_untracked-clean |
|
614 | A removed_untracked-clean | |
621 | A removed_untracked-revert |
|
615 | A removed_untracked-revert | |
622 | A removed_untracked-wc |
|
616 | A removed_untracked-wc | |
623 | A removed_wc |
|
617 | A removed_wc | |
624 | $ hg commit -m 'base' |
|
618 | $ hg commit -m 'base' | |
625 |
|
619 | |||
626 | (create a simple text version of the content) |
|
620 | (create a simple text version of the content) | |
627 |
|
621 | |||
628 | $ python ../dircontent.py > ../content-base.txt |
|
622 | $ python ../dircontent.py > ../content-base.txt | |
629 | $ cat ../content-base.txt |
|
623 | $ cat ../content-base.txt | |
630 | base clean_clean |
|
624 | base clean_clean | |
631 | base clean_deleted |
|
625 | base clean_deleted | |
632 | base clean_removed |
|
626 | base clean_removed | |
633 | base clean_revert |
|
|||
634 | base clean_untracked-clean |
|
627 | base clean_untracked-clean | |
635 | base clean_untracked-revert |
|
|||
636 | base clean_untracked-wc |
|
628 | base clean_untracked-wc | |
637 | base clean_wc |
|
629 | base clean_wc | |
638 | base modified_clean |
|
630 | base modified_clean | |
639 | base modified_deleted |
|
631 | base modified_deleted | |
640 | base modified_removed |
|
632 | base modified_removed | |
641 | base modified_revert |
|
633 | base modified_revert | |
642 | base modified_untracked-clean |
|
634 | base modified_untracked-clean | |
643 | base modified_untracked-revert |
|
635 | base modified_untracked-revert | |
644 | base modified_untracked-wc |
|
636 | base modified_untracked-wc | |
645 | base modified_wc |
|
637 | base modified_wc | |
646 | base removed_clean |
|
638 | base removed_clean | |
647 | base removed_deleted |
|
639 | base removed_deleted | |
648 | base removed_removed |
|
640 | base removed_removed | |
649 | base removed_revert |
|
641 | base removed_revert | |
650 | base removed_untracked-clean |
|
642 | base removed_untracked-clean | |
651 | base removed_untracked-revert |
|
643 | base removed_untracked-revert | |
652 | base removed_untracked-wc |
|
644 | base removed_untracked-wc | |
653 | base removed_wc |
|
645 | base removed_wc | |
654 |
|
646 | |||
655 | Create parent changeset |
|
647 | Create parent changeset | |
656 |
|
648 | |||
657 | $ python ../gen-revert-cases.py parent |
|
649 | $ python ../gen-revert-cases.py parent | |
658 | $ hg addremove --similarity 0 |
|
650 | $ hg addremove --similarity 0 | |
659 | adding added_clean |
|
651 | adding added_clean | |
660 | adding added_deleted |
|
652 | adding added_deleted | |
661 | adding added_removed |
|
653 | adding added_removed | |
662 | adding added_revert |
|
654 | adding added_revert | |
663 | adding added_untracked-clean |
|
655 | adding added_untracked-clean | |
664 | adding added_untracked-revert |
|
656 | adding added_untracked-revert | |
665 | adding added_untracked-wc |
|
657 | adding added_untracked-wc | |
666 | adding added_wc |
|
658 | adding added_wc | |
667 | removing removed_clean |
|
659 | removing removed_clean | |
668 | removing removed_deleted |
|
660 | removing removed_deleted | |
669 | removing removed_removed |
|
661 | removing removed_removed | |
670 | removing removed_revert |
|
662 | removing removed_revert | |
671 | removing removed_untracked-clean |
|
663 | removing removed_untracked-clean | |
672 | removing removed_untracked-revert |
|
664 | removing removed_untracked-revert | |
673 | removing removed_untracked-wc |
|
665 | removing removed_untracked-wc | |
674 | removing removed_wc |
|
666 | removing removed_wc | |
675 | $ hg status |
|
667 | $ hg status | |
676 | M modified_clean |
|
668 | M modified_clean | |
677 | M modified_deleted |
|
669 | M modified_deleted | |
678 | M modified_removed |
|
670 | M modified_removed | |
679 | M modified_revert |
|
671 | M modified_revert | |
680 | M modified_untracked-clean |
|
672 | M modified_untracked-clean | |
681 | M modified_untracked-revert |
|
673 | M modified_untracked-revert | |
682 | M modified_untracked-wc |
|
674 | M modified_untracked-wc | |
683 | M modified_wc |
|
675 | M modified_wc | |
684 | A added_clean |
|
676 | A added_clean | |
685 | A added_deleted |
|
677 | A added_deleted | |
686 | A added_removed |
|
678 | A added_removed | |
687 | A added_revert |
|
679 | A added_revert | |
688 | A added_untracked-clean |
|
680 | A added_untracked-clean | |
689 | A added_untracked-revert |
|
681 | A added_untracked-revert | |
690 | A added_untracked-wc |
|
682 | A added_untracked-wc | |
691 | A added_wc |
|
683 | A added_wc | |
692 | R removed_clean |
|
684 | R removed_clean | |
693 | R removed_deleted |
|
685 | R removed_deleted | |
694 | R removed_removed |
|
686 | R removed_removed | |
695 | R removed_revert |
|
687 | R removed_revert | |
696 | R removed_untracked-clean |
|
688 | R removed_untracked-clean | |
697 | R removed_untracked-revert |
|
689 | R removed_untracked-revert | |
698 | R removed_untracked-wc |
|
690 | R removed_untracked-wc | |
699 | R removed_wc |
|
691 | R removed_wc | |
700 | $ hg commit -m 'parent' |
|
692 | $ hg commit -m 'parent' | |
701 |
|
693 | |||
702 | (create a simple text version of the content) |
|
694 | (create a simple text version of the content) | |
703 |
|
695 | |||
704 | $ python ../dircontent.py > ../content-parent.txt |
|
696 | $ python ../dircontent.py > ../content-parent.txt | |
705 | $ cat ../content-parent.txt |
|
697 | $ cat ../content-parent.txt | |
706 | parent added_clean |
|
698 | parent added_clean | |
707 | parent added_deleted |
|
699 | parent added_deleted | |
708 | parent added_removed |
|
700 | parent added_removed | |
709 | parent added_revert |
|
701 | parent added_revert | |
710 | parent added_untracked-clean |
|
702 | parent added_untracked-clean | |
711 | parent added_untracked-revert |
|
703 | parent added_untracked-revert | |
712 | parent added_untracked-wc |
|
704 | parent added_untracked-wc | |
713 | parent added_wc |
|
705 | parent added_wc | |
714 | base clean_clean |
|
706 | base clean_clean | |
715 | base clean_deleted |
|
707 | base clean_deleted | |
716 | base clean_removed |
|
708 | base clean_removed | |
717 | base clean_revert |
|
|||
718 | base clean_untracked-clean |
|
709 | base clean_untracked-clean | |
719 | base clean_untracked-revert |
|
|||
720 | base clean_untracked-wc |
|
710 | base clean_untracked-wc | |
721 | base clean_wc |
|
711 | base clean_wc | |
722 | parent modified_clean |
|
712 | parent modified_clean | |
723 | parent modified_deleted |
|
713 | parent modified_deleted | |
724 | parent modified_removed |
|
714 | parent modified_removed | |
725 | parent modified_revert |
|
715 | parent modified_revert | |
726 | parent modified_untracked-clean |
|
716 | parent modified_untracked-clean | |
727 | parent modified_untracked-revert |
|
717 | parent modified_untracked-revert | |
728 | parent modified_untracked-wc |
|
718 | parent modified_untracked-wc | |
729 | parent modified_wc |
|
719 | parent modified_wc | |
730 |
|
720 | |||
731 | Setup working directory |
|
721 | Setup working directory | |
732 |
|
722 | |||
733 | $ python ../gen-revert-cases.py wc |
|
723 | $ python ../gen-revert-cases.py wc | |
734 | $ hg addremove --similarity 0 |
|
724 | $ hg addremove --similarity 0 | |
735 | removing added_removed |
|
725 | removing added_removed | |
736 | removing added_revert |
|
726 | removing added_revert | |
737 | removing added_untracked-revert |
|
727 | removing added_untracked-revert | |
738 | removing clean_removed |
|
728 | removing clean_removed | |
739 | adding missing_deleted |
|
729 | adding missing_deleted | |
740 | adding missing_untracked-wc |
|
730 | adding missing_untracked-wc | |
741 | adding missing_wc |
|
731 | adding missing_wc | |
742 | removing modified_removed |
|
732 | removing modified_removed | |
743 | adding removed_deleted |
|
733 | adding removed_deleted | |
744 | adding removed_revert |
|
734 | adding removed_revert | |
745 | adding removed_untracked-revert |
|
735 | adding removed_untracked-revert | |
746 | adding removed_untracked-wc |
|
736 | adding removed_untracked-wc | |
747 | adding removed_wc |
|
737 | adding removed_wc | |
748 | $ hg forget *untracked* |
|
738 | $ hg forget *untracked* | |
749 | $ rm *deleted* |
|
739 | $ rm *deleted* | |
750 | $ hg status |
|
740 | $ hg status | |
751 | M added_wc |
|
741 | M added_wc | |
752 | M clean_wc |
|
742 | M clean_wc | |
753 | M modified_revert |
|
743 | M modified_revert | |
754 | M modified_wc |
|
744 | M modified_wc | |
755 | A missing_wc |
|
745 | A missing_wc | |
756 | A removed_revert |
|
746 | A removed_revert | |
757 | A removed_wc |
|
747 | A removed_wc | |
758 | R added_removed |
|
748 | R added_removed | |
759 | R added_revert |
|
749 | R added_revert | |
760 | R added_untracked-clean |
|
750 | R added_untracked-clean | |
761 | R added_untracked-revert |
|
751 | R added_untracked-revert | |
762 | R added_untracked-wc |
|
752 | R added_untracked-wc | |
763 | R clean_removed |
|
753 | R clean_removed | |
764 | R clean_untracked-clean |
|
754 | R clean_untracked-clean | |
765 | R clean_untracked-revert |
|
|||
766 | R clean_untracked-wc |
|
755 | R clean_untracked-wc | |
767 | R modified_removed |
|
756 | R modified_removed | |
768 | R modified_untracked-clean |
|
757 | R modified_untracked-clean | |
769 | R modified_untracked-revert |
|
758 | R modified_untracked-revert | |
770 | R modified_untracked-wc |
|
759 | R modified_untracked-wc | |
771 | ! added_deleted |
|
760 | ! added_deleted | |
772 | ! clean_deleted |
|
761 | ! clean_deleted | |
773 | ! missing_deleted |
|
762 | ! missing_deleted | |
774 | ! modified_deleted |
|
763 | ! modified_deleted | |
775 | ! removed_deleted |
|
764 | ! removed_deleted | |
776 | ? missing_untracked-wc |
|
765 | ? missing_untracked-wc | |
777 | ? removed_untracked-revert |
|
766 | ? removed_untracked-revert | |
778 | ? removed_untracked-wc |
|
767 | ? removed_untracked-wc | |
779 |
|
768 | |||
780 | $ hg status --rev 'desc("base")' |
|
769 | $ hg status --rev 'desc("base")' | |
781 | M clean_wc |
|
770 | M clean_wc | |
782 | M modified_clean |
|
771 | M modified_clean | |
783 | M modified_wc |
|
772 | M modified_wc | |
784 | M removed_wc |
|
773 | M removed_wc | |
785 | A added_clean |
|
774 | A added_clean | |
786 | A added_wc |
|
775 | A added_wc | |
787 | A missing_wc |
|
776 | A missing_wc | |
788 | R clean_removed |
|
777 | R clean_removed | |
789 | R clean_untracked-clean |
|
778 | R clean_untracked-clean | |
790 | R clean_untracked-revert |
|
|||
791 | R clean_untracked-wc |
|
779 | R clean_untracked-wc | |
792 | R modified_removed |
|
780 | R modified_removed | |
793 | R modified_untracked-clean |
|
781 | R modified_untracked-clean | |
794 | R modified_untracked-revert |
|
782 | R modified_untracked-revert | |
795 | R modified_untracked-wc |
|
783 | R modified_untracked-wc | |
796 | R removed_clean |
|
784 | R removed_clean | |
797 | R removed_deleted |
|
785 | R removed_deleted | |
798 | R removed_removed |
|
786 | R removed_removed | |
799 | R removed_untracked-clean |
|
787 | R removed_untracked-clean | |
800 | R removed_untracked-revert |
|
788 | R removed_untracked-revert | |
801 | R removed_untracked-wc |
|
789 | R removed_untracked-wc | |
802 | ! added_deleted |
|
790 | ! added_deleted | |
803 | ! clean_deleted |
|
791 | ! clean_deleted | |
804 | ! missing_deleted |
|
792 | ! missing_deleted | |
805 | ! modified_deleted |
|
793 | ! modified_deleted | |
806 | ! removed_deleted |
|
794 | ! removed_deleted | |
807 | ? missing_untracked-wc |
|
795 | ? missing_untracked-wc | |
808 |
|
796 | |||
809 | (create a simple text version of the content) |
|
797 | (create a simple text version of the content) | |
810 |
|
798 | |||
811 | $ python ../dircontent.py > ../content-wc.txt |
|
799 | $ python ../dircontent.py > ../content-wc.txt | |
812 | $ cat ../content-wc.txt |
|
800 | $ cat ../content-wc.txt | |
813 | parent added_clean |
|
801 | parent added_clean | |
814 | parent added_untracked-clean |
|
802 | parent added_untracked-clean | |
815 | wc added_untracked-wc |
|
803 | wc added_untracked-wc | |
816 | wc added_wc |
|
804 | wc added_wc | |
817 | base clean_clean |
|
805 | base clean_clean | |
818 | base clean_revert |
|
|||
819 | base clean_untracked-clean |
|
806 | base clean_untracked-clean | |
820 | base clean_untracked-revert |
|
|||
821 | wc clean_untracked-wc |
|
807 | wc clean_untracked-wc | |
822 | wc clean_wc |
|
808 | wc clean_wc | |
823 | wc missing_untracked-wc |
|
809 | wc missing_untracked-wc | |
824 | wc missing_wc |
|
810 | wc missing_wc | |
825 | parent modified_clean |
|
811 | parent modified_clean | |
826 | base modified_revert |
|
812 | base modified_revert | |
827 | parent modified_untracked-clean |
|
813 | parent modified_untracked-clean | |
828 | base modified_untracked-revert |
|
814 | base modified_untracked-revert | |
829 | wc modified_untracked-wc |
|
815 | wc modified_untracked-wc | |
830 | wc modified_wc |
|
816 | wc modified_wc | |
831 | base removed_revert |
|
817 | base removed_revert | |
832 | base removed_untracked-revert |
|
818 | base removed_untracked-revert | |
833 | wc removed_untracked-wc |
|
819 | wc removed_untracked-wc | |
834 | wc removed_wc |
|
820 | wc removed_wc | |
835 |
|
821 | |||
836 | $ cd .. |
|
822 | $ cd .. | |
837 |
|
823 | |||
838 | Test revert --all to parent content |
|
824 | Test revert --all to parent content | |
839 | ----------------------------------- |
|
825 | ----------------------------------- | |
840 |
|
826 | |||
841 | (setup from reference repo) |
|
827 | (setup from reference repo) | |
842 |
|
828 | |||
843 | $ cp -r revert-ref revert-parent-all |
|
829 | $ cp -r revert-ref revert-parent-all | |
844 | $ cd revert-parent-all |
|
830 | $ cd revert-parent-all | |
845 |
|
831 | |||
846 | check revert output |
|
832 | check revert output | |
847 |
|
833 | |||
848 | $ hg revert --all |
|
834 | $ hg revert --all | |
849 | reverting added_deleted |
|
835 | reverting added_deleted | |
850 | undeleting added_removed |
|
836 | undeleting added_removed | |
851 | undeleting added_revert |
|
837 | undeleting added_revert | |
852 | undeleting added_untracked-clean |
|
838 | undeleting added_untracked-clean | |
853 | undeleting added_untracked-revert |
|
839 | undeleting added_untracked-revert | |
854 | undeleting added_untracked-wc |
|
840 | undeleting added_untracked-wc | |
855 | reverting added_wc |
|
841 | reverting added_wc | |
856 | reverting clean_deleted |
|
842 | reverting clean_deleted | |
857 | undeleting clean_removed |
|
843 | undeleting clean_removed | |
858 | undeleting clean_untracked-clean |
|
844 | undeleting clean_untracked-clean | |
859 | undeleting clean_untracked-revert |
|
|||
860 | undeleting clean_untracked-wc |
|
845 | undeleting clean_untracked-wc | |
861 | reverting clean_wc |
|
846 | reverting clean_wc | |
862 | forgetting missing_deleted |
|
847 | forgetting missing_deleted | |
863 | forgetting missing_wc |
|
848 | forgetting missing_wc | |
864 | reverting modified_deleted |
|
849 | reverting modified_deleted | |
865 | undeleting modified_removed |
|
850 | undeleting modified_removed | |
866 | reverting modified_revert |
|
851 | reverting modified_revert | |
867 | undeleting modified_untracked-clean |
|
852 | undeleting modified_untracked-clean | |
868 | undeleting modified_untracked-revert |
|
853 | undeleting modified_untracked-revert | |
869 | undeleting modified_untracked-wc |
|
854 | undeleting modified_untracked-wc | |
870 | reverting modified_wc |
|
855 | reverting modified_wc | |
871 | forgetting removed_deleted |
|
856 | forgetting removed_deleted | |
872 | forgetting removed_revert |
|
857 | forgetting removed_revert | |
873 | forgetting removed_wc |
|
858 | forgetting removed_wc | |
874 |
|
859 | |||
875 | Compare resulting directory with revert target. |
|
860 | Compare resulting directory with revert target. | |
876 |
|
861 | |||
877 | The diff is filtered to include change only. The only difference should be |
|
862 | The diff is filtered to include change only. The only difference should be | |
878 | additional `.orig` backup file when applicable. |
|
863 | additional `.orig` backup file when applicable. | |
879 |
|
864 | |||
880 | $ python ../dircontent.py > ../content-parent-all.txt |
|
865 | $ python ../dircontent.py > ../content-parent-all.txt | |
881 | $ cd .. |
|
866 | $ cd .. | |
882 | $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _ |
|
867 | $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _ | |
883 | +wc added_untracked-wc.orig |
|
868 | +wc added_untracked-wc.orig | |
884 | +wc added_wc.orig |
|
869 | +wc added_wc.orig | |
885 | +wc clean_untracked-wc.orig |
|
870 | +wc clean_untracked-wc.orig | |
886 | +wc clean_wc.orig |
|
871 | +wc clean_wc.orig | |
887 | +wc missing_untracked-wc |
|
872 | +wc missing_untracked-wc | |
888 | +wc missing_wc |
|
873 | +wc missing_wc | |
889 | +base modified_revert.orig |
|
874 | +base modified_revert.orig | |
890 | +base modified_untracked-revert.orig |
|
875 | +base modified_untracked-revert.orig | |
891 | +wc modified_untracked-wc.orig |
|
876 | +wc modified_untracked-wc.orig | |
892 | +wc modified_wc.orig |
|
877 | +wc modified_wc.orig | |
893 | +base removed_revert |
|
878 | +base removed_revert | |
894 | +base removed_untracked-revert |
|
879 | +base removed_untracked-revert | |
895 | +wc removed_untracked-wc |
|
880 | +wc removed_untracked-wc | |
896 | +wc removed_wc |
|
881 | +wc removed_wc | |
897 |
|
882 | |||
898 | Test revert --all to "base" content |
|
883 | Test revert --all to "base" content | |
899 | ----------------------------------- |
|
884 | ----------------------------------- | |
900 |
|
885 | |||
901 | (setup from reference repo) |
|
886 | (setup from reference repo) | |
902 |
|
887 | |||
903 | $ cp -r revert-ref revert-base-all |
|
888 | $ cp -r revert-ref revert-base-all | |
904 | $ cd revert-base-all |
|
889 | $ cd revert-base-all | |
905 |
|
890 | |||
906 | check revert output |
|
891 | check revert output | |
907 |
|
892 | |||
908 | $ hg revert --all --rev 'desc(base)' |
|
893 | $ hg revert --all --rev 'desc(base)' | |
909 | removing added_clean |
|
894 | removing added_clean | |
910 | removing added_deleted |
|
895 | removing added_deleted | |
911 | removing added_wc |
|
896 | removing added_wc | |
912 | reverting clean_deleted |
|
897 | reverting clean_deleted | |
913 | undeleting clean_removed |
|
898 | undeleting clean_removed | |
914 | undeleting clean_untracked-clean |
|
899 | undeleting clean_untracked-clean | |
915 | undeleting clean_untracked-revert |
|
|||
916 | undeleting clean_untracked-wc |
|
900 | undeleting clean_untracked-wc | |
917 | reverting clean_wc |
|
901 | reverting clean_wc | |
918 | forgetting missing_deleted |
|
902 | forgetting missing_deleted | |
919 | forgetting missing_wc |
|
903 | forgetting missing_wc | |
920 | reverting modified_clean |
|
904 | reverting modified_clean | |
921 | reverting modified_deleted |
|
905 | reverting modified_deleted | |
922 | undeleting modified_removed |
|
906 | undeleting modified_removed | |
923 | undeleting modified_untracked-clean |
|
907 | undeleting modified_untracked-clean | |
924 | undeleting modified_untracked-revert |
|
908 | undeleting modified_untracked-revert | |
925 | undeleting modified_untracked-wc |
|
909 | undeleting modified_untracked-wc | |
926 | reverting modified_wc |
|
910 | reverting modified_wc | |
927 | adding removed_clean |
|
911 | adding removed_clean | |
928 | reverting removed_deleted |
|
912 | reverting removed_deleted | |
929 | adding removed_removed |
|
913 | adding removed_removed | |
930 | adding removed_untracked-clean |
|
914 | adding removed_untracked-clean | |
931 | adding removed_untracked-revert |
|
915 | adding removed_untracked-revert | |
932 | adding removed_untracked-wc |
|
916 | adding removed_untracked-wc | |
933 | reverting removed_wc |
|
917 | reverting removed_wc | |
934 |
|
918 | |||
935 | Compare resulting directory with revert target. |
|
919 | Compare resulting directory with revert target. | |
936 |
|
920 | |||
937 | The diff is filtered to include change only. The only difference should be |
|
921 | The diff is filtered to include change only. The only difference should be | |
938 | additional `.orig` backup file when applicable. |
|
922 | additional `.orig` backup file when applicable. | |
939 |
|
923 | |||
940 | $ python ../dircontent.py > ../content-base-all.txt |
|
924 | $ python ../dircontent.py > ../content-base-all.txt | |
941 | $ cd .. |
|
925 | $ cd .. | |
942 | $ diff -U 0 -- content-base.txt content-base-all.txt | grep _ |
|
926 | $ diff -U 0 -- content-base.txt content-base-all.txt | grep _ | |
943 | +parent added_untracked-clean |
|
927 | +parent added_untracked-clean | |
944 | +wc added_untracked-wc |
|
928 | +wc added_untracked-wc | |
945 | +wc added_wc.orig |
|
929 | +wc added_wc.orig | |
946 | +wc clean_untracked-wc.orig |
|
930 | +wc clean_untracked-wc.orig | |
947 | +wc clean_wc.orig |
|
931 | +wc clean_wc.orig | |
948 | +wc missing_untracked-wc |
|
932 | +wc missing_untracked-wc | |
949 | +wc missing_wc |
|
933 | +wc missing_wc | |
950 | +parent modified_untracked-clean.orig |
|
934 | +parent modified_untracked-clean.orig | |
951 | +wc modified_untracked-wc.orig |
|
935 | +wc modified_untracked-wc.orig | |
952 | +wc modified_wc.orig |
|
936 | +wc modified_wc.orig | |
953 | +wc removed_untracked-wc.orig |
|
937 | +wc removed_untracked-wc.orig | |
954 | +wc removed_wc.orig |
|
938 | +wc removed_wc.orig | |
955 |
|
939 | |||
956 | Test revert to parent content with explicit file name |
|
940 | Test revert to parent content with explicit file name | |
957 | ----------------------------------------------------- |
|
941 | ----------------------------------------------------- | |
958 |
|
942 | |||
959 | (setup from reference repo) |
|
943 | (setup from reference repo) | |
960 |
|
944 | |||
961 | $ cp -r revert-ref revert-parent-explicit |
|
945 | $ cp -r revert-ref revert-parent-explicit | |
962 | $ cd revert-parent-explicit |
|
946 | $ cd revert-parent-explicit | |
963 |
|
947 | |||
964 | revert all files individually and check the output |
|
948 | revert all files individually and check the output | |
965 | (output is expected to be different than in the --all case) |
|
949 | (output is expected to be different than in the --all case) | |
966 |
|
950 | |||
967 | $ for file in `python ../gen-revert-cases.py filelist`; do |
|
951 | $ for file in `python ../gen-revert-cases.py filelist`; do | |
968 | > echo '### revert for:' $file; |
|
952 | > echo '### revert for:' $file; | |
969 | > hg revert $file; |
|
953 | > hg revert $file; | |
970 | > echo |
|
954 | > echo | |
971 | > done |
|
955 | > done | |
972 | ### revert for: added_clean |
|
956 | ### revert for: added_clean | |
973 | no changes needed to added_clean |
|
957 | no changes needed to added_clean | |
974 |
|
958 | |||
975 | ### revert for: added_deleted |
|
959 | ### revert for: added_deleted | |
976 |
|
960 | |||
977 | ### revert for: added_removed |
|
961 | ### revert for: added_removed | |
978 |
|
962 | |||
979 | ### revert for: added_revert |
|
963 | ### revert for: added_revert | |
980 |
|
964 | |||
981 | ### revert for: added_untracked-clean |
|
965 | ### revert for: added_untracked-clean | |
982 |
|
966 | |||
983 | ### revert for: added_untracked-revert |
|
967 | ### revert for: added_untracked-revert | |
984 |
|
968 | |||
985 | ### revert for: added_untracked-wc |
|
969 | ### revert for: added_untracked-wc | |
986 |
|
970 | |||
987 | ### revert for: added_wc |
|
971 | ### revert for: added_wc | |
988 |
|
972 | |||
989 | ### revert for: clean_clean |
|
973 | ### revert for: clean_clean | |
990 | no changes needed to clean_clean |
|
974 | no changes needed to clean_clean | |
991 |
|
975 | |||
992 | ### revert for: clean_deleted |
|
976 | ### revert for: clean_deleted | |
993 |
|
977 | |||
994 | ### revert for: clean_removed |
|
978 | ### revert for: clean_removed | |
995 |
|
979 | |||
996 | ### revert for: clean_revert |
|
|||
997 | no changes needed to clean_revert |
|
|||
998 |
|
||||
999 | ### revert for: clean_untracked-clean |
|
980 | ### revert for: clean_untracked-clean | |
1000 |
|
981 | |||
1001 | ### revert for: clean_untracked-revert |
|
|||
1002 |
|
||||
1003 | ### revert for: clean_untracked-wc |
|
982 | ### revert for: clean_untracked-wc | |
1004 |
|
983 | |||
1005 | ### revert for: clean_wc |
|
984 | ### revert for: clean_wc | |
1006 |
|
985 | |||
1007 | ### revert for: missing_clean |
|
986 | ### revert for: missing_clean | |
1008 | missing_clean: no such file in rev * (glob) |
|
987 | missing_clean: no such file in rev * (glob) | |
1009 |
|
988 | |||
1010 | ### revert for: missing_deleted |
|
989 | ### revert for: missing_deleted | |
1011 |
|
990 | |||
1012 | ### revert for: missing_removed |
|
991 | ### revert for: missing_removed | |
1013 | missing_removed: no such file in rev * (glob) |
|
992 | missing_removed: no such file in rev * (glob) | |
1014 |
|
993 | |||
1015 | ### revert for: missing_revert |
|
|||
1016 | missing_revert: no such file in rev * (glob) |
|
|||
1017 |
|
||||
1018 | ### revert for: missing_untracked-clean |
|
994 | ### revert for: missing_untracked-clean | |
1019 | missing_untracked-clean: no such file in rev * (glob) |
|
995 | missing_untracked-clean: no such file in rev * (glob) | |
1020 |
|
996 | |||
1021 | ### revert for: missing_untracked-revert |
|
|||
1022 | missing_untracked-revert: no such file in rev * (glob) |
|
|||
1023 |
|
||||
1024 | ### revert for: missing_untracked-wc |
|
997 | ### revert for: missing_untracked-wc | |
1025 | file not managed: missing_untracked-wc |
|
998 | file not managed: missing_untracked-wc | |
1026 |
|
999 | |||
1027 | ### revert for: missing_wc |
|
1000 | ### revert for: missing_wc | |
1028 |
|
1001 | |||
1029 | ### revert for: modified_clean |
|
1002 | ### revert for: modified_clean | |
1030 | no changes needed to modified_clean |
|
1003 | no changes needed to modified_clean | |
1031 |
|
1004 | |||
1032 | ### revert for: modified_deleted |
|
1005 | ### revert for: modified_deleted | |
1033 |
|
1006 | |||
1034 | ### revert for: modified_removed |
|
1007 | ### revert for: modified_removed | |
1035 |
|
1008 | |||
1036 | ### revert for: modified_revert |
|
1009 | ### revert for: modified_revert | |
1037 |
|
1010 | |||
1038 | ### revert for: modified_untracked-clean |
|
1011 | ### revert for: modified_untracked-clean | |
1039 |
|
1012 | |||
1040 | ### revert for: modified_untracked-revert |
|
1013 | ### revert for: modified_untracked-revert | |
1041 |
|
1014 | |||
1042 | ### revert for: modified_untracked-wc |
|
1015 | ### revert for: modified_untracked-wc | |
1043 |
|
1016 | |||
1044 | ### revert for: modified_wc |
|
1017 | ### revert for: modified_wc | |
1045 |
|
1018 | |||
1046 | ### revert for: removed_clean |
|
1019 | ### revert for: removed_clean | |
1047 | removed_clean: no such file in rev * (glob) |
|
1020 | removed_clean: no such file in rev * (glob) | |
1048 |
|
1021 | |||
1049 | ### revert for: removed_deleted |
|
1022 | ### revert for: removed_deleted | |
1050 |
|
1023 | |||
1051 | ### revert for: removed_removed |
|
1024 | ### revert for: removed_removed | |
1052 | removed_removed: no such file in rev * (glob) |
|
1025 | removed_removed: no such file in rev * (glob) | |
1053 |
|
1026 | |||
1054 | ### revert for: removed_revert |
|
1027 | ### revert for: removed_revert | |
1055 |
|
1028 | |||
1056 | ### revert for: removed_untracked-clean |
|
1029 | ### revert for: removed_untracked-clean | |
1057 | removed_untracked-clean: no such file in rev * (glob) |
|
1030 | removed_untracked-clean: no such file in rev * (glob) | |
1058 |
|
1031 | |||
1059 | ### revert for: removed_untracked-revert |
|
1032 | ### revert for: removed_untracked-revert | |
1060 | file not managed: removed_untracked-revert |
|
1033 | file not managed: removed_untracked-revert | |
1061 |
|
1034 | |||
1062 | ### revert for: removed_untracked-wc |
|
1035 | ### revert for: removed_untracked-wc | |
1063 | file not managed: removed_untracked-wc |
|
1036 | file not managed: removed_untracked-wc | |
1064 |
|
1037 | |||
1065 | ### revert for: removed_wc |
|
1038 | ### revert for: removed_wc | |
1066 |
|
1039 | |||
1067 |
|
1040 | |||
1068 | check resulting directory against the --all run |
|
1041 | check resulting directory against the --all run | |
1069 | (There should be no difference) |
|
1042 | (There should be no difference) | |
1070 |
|
1043 | |||
1071 | $ python ../dircontent.py > ../content-parent-explicit.txt |
|
1044 | $ python ../dircontent.py > ../content-parent-explicit.txt | |
1072 | $ cd .. |
|
1045 | $ cd .. | |
1073 | $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _ |
|
1046 | $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _ | |
1074 | [1] |
|
1047 | [1] | |
1075 |
|
1048 | |||
1076 | Test revert to "base" content with explicit file name |
|
1049 | Test revert to "base" content with explicit file name | |
1077 | ----------------------------------------------------- |
|
1050 | ----------------------------------------------------- | |
1078 |
|
1051 | |||
1079 | (setup from reference repo) |
|
1052 | (setup from reference repo) | |
1080 |
|
1053 | |||
1081 | $ cp -r revert-ref revert-base-explicit |
|
1054 | $ cp -r revert-ref revert-base-explicit | |
1082 | $ cd revert-base-explicit |
|
1055 | $ cd revert-base-explicit | |
1083 |
|
1056 | |||
1084 | revert all files individually and check the output |
|
1057 | revert all files individually and check the output | |
1085 | (output is expected to be different than in the --all case) |
|
1058 | (output is expected to be different than in the --all case) | |
1086 |
|
1059 | |||
1087 | $ for file in `python ../gen-revert-cases.py filelist`; do |
|
1060 | $ for file in `python ../gen-revert-cases.py filelist`; do | |
1088 | > echo '### revert for:' $file; |
|
1061 | > echo '### revert for:' $file; | |
1089 | > hg revert $file --rev 'desc(base)'; |
|
1062 | > hg revert $file --rev 'desc(base)'; | |
1090 | > echo |
|
1063 | > echo | |
1091 | > done |
|
1064 | > done | |
1092 | ### revert for: added_clean |
|
1065 | ### revert for: added_clean | |
1093 |
|
1066 | |||
1094 | ### revert for: added_deleted |
|
1067 | ### revert for: added_deleted | |
1095 |
|
1068 | |||
1096 | ### revert for: added_removed |
|
1069 | ### revert for: added_removed | |
1097 | no changes needed to added_removed |
|
1070 | no changes needed to added_removed | |
1098 |
|
1071 | |||
1099 | ### revert for: added_revert |
|
1072 | ### revert for: added_revert | |
1100 | no changes needed to added_revert |
|
1073 | no changes needed to added_revert | |
1101 |
|
1074 | |||
1102 | ### revert for: added_untracked-clean |
|
1075 | ### revert for: added_untracked-clean | |
1103 | no changes needed to added_untracked-clean |
|
1076 | no changes needed to added_untracked-clean | |
1104 |
|
1077 | |||
1105 | ### revert for: added_untracked-revert |
|
1078 | ### revert for: added_untracked-revert | |
1106 | no changes needed to added_untracked-revert |
|
1079 | no changes needed to added_untracked-revert | |
1107 |
|
1080 | |||
1108 | ### revert for: added_untracked-wc |
|
1081 | ### revert for: added_untracked-wc | |
1109 | no changes needed to added_untracked-wc |
|
1082 | no changes needed to added_untracked-wc | |
1110 |
|
1083 | |||
1111 | ### revert for: added_wc |
|
1084 | ### revert for: added_wc | |
1112 |
|
1085 | |||
1113 | ### revert for: clean_clean |
|
1086 | ### revert for: clean_clean | |
1114 | no changes needed to clean_clean |
|
1087 | no changes needed to clean_clean | |
1115 |
|
1088 | |||
1116 | ### revert for: clean_deleted |
|
1089 | ### revert for: clean_deleted | |
1117 |
|
1090 | |||
1118 | ### revert for: clean_removed |
|
1091 | ### revert for: clean_removed | |
1119 |
|
1092 | |||
1120 | ### revert for: clean_revert |
|
|||
1121 | no changes needed to clean_revert |
|
|||
1122 |
|
||||
1123 | ### revert for: clean_untracked-clean |
|
1093 | ### revert for: clean_untracked-clean | |
1124 |
|
1094 | |||
1125 | ### revert for: clean_untracked-revert |
|
|||
1126 |
|
||||
1127 | ### revert for: clean_untracked-wc |
|
1095 | ### revert for: clean_untracked-wc | |
1128 |
|
1096 | |||
1129 | ### revert for: clean_wc |
|
1097 | ### revert for: clean_wc | |
1130 |
|
1098 | |||
1131 | ### revert for: missing_clean |
|
1099 | ### revert for: missing_clean | |
1132 | missing_clean: no such file in rev * (glob) |
|
1100 | missing_clean: no such file in rev * (glob) | |
1133 |
|
1101 | |||
1134 | ### revert for: missing_deleted |
|
1102 | ### revert for: missing_deleted | |
1135 |
|
1103 | |||
1136 | ### revert for: missing_removed |
|
1104 | ### revert for: missing_removed | |
1137 | missing_removed: no such file in rev * (glob) |
|
1105 | missing_removed: no such file in rev * (glob) | |
1138 |
|
1106 | |||
1139 | ### revert for: missing_revert |
|
|||
1140 | missing_revert: no such file in rev * (glob) |
|
|||
1141 |
|
||||
1142 | ### revert for: missing_untracked-clean |
|
1107 | ### revert for: missing_untracked-clean | |
1143 | missing_untracked-clean: no such file in rev * (glob) |
|
1108 | missing_untracked-clean: no such file in rev * (glob) | |
1144 |
|
1109 | |||
1145 | ### revert for: missing_untracked-revert |
|
|||
1146 | missing_untracked-revert: no such file in rev * (glob) |
|
|||
1147 |
|
||||
1148 | ### revert for: missing_untracked-wc |
|
1110 | ### revert for: missing_untracked-wc | |
1149 | file not managed: missing_untracked-wc |
|
1111 | file not managed: missing_untracked-wc | |
1150 |
|
1112 | |||
1151 | ### revert for: missing_wc |
|
1113 | ### revert for: missing_wc | |
1152 |
|
1114 | |||
1153 | ### revert for: modified_clean |
|
1115 | ### revert for: modified_clean | |
1154 |
|
1116 | |||
1155 | ### revert for: modified_deleted |
|
1117 | ### revert for: modified_deleted | |
1156 |
|
1118 | |||
1157 | ### revert for: modified_removed |
|
1119 | ### revert for: modified_removed | |
1158 |
|
1120 | |||
1159 | ### revert for: modified_revert |
|
1121 | ### revert for: modified_revert | |
1160 | no changes needed to modified_revert |
|
1122 | no changes needed to modified_revert | |
1161 |
|
1123 | |||
1162 | ### revert for: modified_untracked-clean |
|
1124 | ### revert for: modified_untracked-clean | |
1163 |
|
1125 | |||
1164 | ### revert for: modified_untracked-revert |
|
1126 | ### revert for: modified_untracked-revert | |
1165 |
|
1127 | |||
1166 | ### revert for: modified_untracked-wc |
|
1128 | ### revert for: modified_untracked-wc | |
1167 |
|
1129 | |||
1168 | ### revert for: modified_wc |
|
1130 | ### revert for: modified_wc | |
1169 |
|
1131 | |||
1170 | ### revert for: removed_clean |
|
1132 | ### revert for: removed_clean | |
1171 |
|
1133 | |||
1172 | ### revert for: removed_deleted |
|
1134 | ### revert for: removed_deleted | |
1173 |
|
1135 | |||
1174 | ### revert for: removed_removed |
|
1136 | ### revert for: removed_removed | |
1175 |
|
1137 | |||
1176 | ### revert for: removed_revert |
|
1138 | ### revert for: removed_revert | |
1177 | no changes needed to removed_revert |
|
1139 | no changes needed to removed_revert | |
1178 |
|
1140 | |||
1179 | ### revert for: removed_untracked-clean |
|
1141 | ### revert for: removed_untracked-clean | |
1180 |
|
1142 | |||
1181 | ### revert for: removed_untracked-revert |
|
1143 | ### revert for: removed_untracked-revert | |
1182 |
|
1144 | |||
1183 | ### revert for: removed_untracked-wc |
|
1145 | ### revert for: removed_untracked-wc | |
1184 |
|
1146 | |||
1185 | ### revert for: removed_wc |
|
1147 | ### revert for: removed_wc | |
1186 |
|
1148 | |||
1187 |
|
1149 | |||
1188 | check resulting directory against the --all run |
|
1150 | check resulting directory against the --all run | |
1189 | (There should be no difference) |
|
1151 | (There should be no difference) | |
1190 |
|
1152 | |||
1191 | $ python ../dircontent.py > ../content-base-explicit.txt |
|
1153 | $ python ../dircontent.py > ../content-base-explicit.txt | |
1192 | $ cd .. |
|
1154 | $ cd .. | |
1193 | $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _ |
|
1155 | $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _ | |
1194 | [1] |
|
1156 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now