Show More
@@ -14,6 +14,9 b' nothing changed' | |||||
14 | [255] |
|
14 | [255] | |
15 | $ hg revert --all |
|
15 | $ hg revert --all | |
16 |
|
16 | |||
|
17 | Introduce some changes and revert them | |||
|
18 | -------------------------------------- | |||
|
19 | ||||
17 | $ echo 123 > b |
|
20 | $ echo 123 > b | |
18 |
|
21 | |||
19 | should show b unknown |
|
22 | should show b unknown | |
@@ -42,6 +45,9 b' should show a removed, b added and c mod' | |||||
42 | M c |
|
45 | M c | |
43 | A b |
|
46 | A b | |
44 | R a |
|
47 | R a | |
|
48 | ||||
|
49 | revert removal of a file | |||
|
50 | ||||
45 | $ hg revert a |
|
51 | $ hg revert a | |
46 |
|
52 | |||
47 | should show b added, copy saved, and c modified |
|
53 | should show b added, copy saved, and c modified | |
@@ -49,6 +55,9 b' should show b added, copy saved, and c m' | |||||
49 | $ hg status |
|
55 | $ hg status | |
50 | M c |
|
56 | M c | |
51 | A b |
|
57 | A b | |
|
58 | ||||
|
59 | revert addition of a file | |||
|
60 | ||||
52 | $ hg revert b |
|
61 | $ hg revert b | |
53 |
|
62 | |||
54 | should show b unknown, and c modified |
|
63 | should show b unknown, and c modified | |
@@ -56,12 +65,19 b' should show b unknown, and c modified' | |||||
56 | $ hg status |
|
65 | $ hg status | |
57 | M c |
|
66 | M c | |
58 | ? b |
|
67 | ? b | |
|
68 | ||||
|
69 | revert modification of a file (--no-backup) | |||
|
70 | ||||
59 | $ hg revert --no-backup c |
|
71 | $ hg revert --no-backup c | |
60 |
|
72 | |||
61 | should show unknown: b |
|
73 | should show unknown: b | |
62 |
|
74 | |||
63 | $ hg status |
|
75 | $ hg status | |
64 | ? b |
|
76 | ? b | |
|
77 | ||||
|
78 | revert deletion (! status) of a added file | |||
|
79 | ------------------------------------------ | |||
|
80 | ||||
65 | $ hg add b |
|
81 | $ hg add b | |
66 |
|
82 | |||
67 | should show b added |
|
83 | should show b added | |
@@ -89,26 +105,30 b' should show a c e' | |||||
89 | c |
|
105 | c | |
90 | e |
|
106 | e | |
91 |
|
107 | |||
92 | should verbosely save backup to e.orig |
|
108 | Test creation of backup (.orig) files | |
|
109 | ------------------------------------- | |||
93 |
|
110 | |||
94 | $ echo z > e |
|
111 | $ echo z > e | |
95 | $ hg revert --all -v |
|
112 | $ hg revert --all -v | |
96 | saving current version of e as e.orig |
|
113 | saving current version of e as e.orig | |
97 | reverting e |
|
114 | reverting e | |
98 |
|
115 | |||
99 | should say no changes needed |
|
116 | revert on clean file (no change) | |
|
117 | -------------------------------- | |||
100 |
|
118 | |||
101 | $ hg revert a |
|
119 | $ hg revert a | |
102 | no changes needed to a |
|
120 | no changes needed to a | |
103 |
|
121 | |||
104 | should say file not managed |
|
122 | revert on an untracked file | |
|
123 | --------------------------- | |||
105 |
|
124 | |||
106 | $ echo q > q |
|
125 | $ echo q > q | |
107 | $ hg revert q |
|
126 | $ hg revert q | |
108 | file not managed: q |
|
127 | file not managed: q | |
109 | $ rm q |
|
128 | $ rm q | |
110 |
|
129 | |||
111 | should say file not found |
|
130 | revert on file that does not exists | |
|
131 | ----------------------------------- | |||
112 |
|
132 | |||
113 | $ hg revert notfound |
|
133 | $ hg revert notfound | |
114 | notfound: no such file in rev 334a9e57682c |
|
134 | notfound: no such file in rev 334a9e57682c | |
@@ -122,21 +142,26 b' should say file not found' | |||||
122 | A z |
|
142 | A z | |
123 | ? e.orig |
|
143 | ? e.orig | |
124 |
|
144 | |||
125 | should add a, remove d, forget z |
|
145 | revert to another revision (--rev) | |
|
146 | ---------------------------------- | |||
126 |
|
147 | |||
127 | $ hg revert --all -r0 |
|
148 | $ hg revert --all -r0 | |
128 | adding a |
|
149 | adding a | |
129 | removing d |
|
150 | removing d | |
130 | forgetting z |
|
151 | forgetting z | |
131 |
|
152 | |||
132 | should forget a, undelete d |
|
153 | revert explicitly to parent (--rev) | |
|
154 | ----------------------------------- | |||
133 |
|
155 | |||
134 | $ hg revert --all -rtip |
|
156 | $ hg revert --all -rtip | |
135 | forgetting a |
|
157 | forgetting a | |
136 | undeleting d |
|
158 | undeleting d | |
137 | $ rm a *.orig |
|
159 | $ rm a *.orig | |
138 |
|
160 | |||
139 | should silently add a |
|
161 | revert to another revision (--rev) and exact match | |
|
162 | -------------------------------------------------- | |||
|
163 | ||||
|
164 | exact match are more silent | |||
140 |
|
165 | |||
141 | $ hg revert -r0 a |
|
166 | $ hg revert -r0 a | |
142 | $ hg st a |
|
167 | $ hg st a | |
@@ -153,6 +178,10 b' should silently keep d removed' | |||||
153 |
|
178 | |||
154 | $ hg update -C |
|
179 | $ hg update -C | |
155 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
180 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
181 | ||||
|
182 | revert of exec bit | |||
|
183 | ------------------ | |||
|
184 | ||||
156 | #if execbit |
|
185 | #if execbit | |
157 | $ chmod +x c |
|
186 | $ chmod +x c | |
158 | $ hg revert --all |
|
187 | $ hg revert --all | |
@@ -180,6 +209,7 b' should print executable' | |||||
180 |
|
209 | |||
181 |
|
210 | |||
182 | Issue241: update and revert produces inconsistent repositories |
|
211 | Issue241: update and revert produces inconsistent repositories | |
|
212 | -------------------------------------------------------------- | |||
183 |
|
213 | |||
184 | $ hg init a |
|
214 | $ hg init a | |
185 | $ cd a |
|
215 | $ cd a | |
@@ -193,20 +223,23 b' Issue241: update and revert produces inc' | |||||
193 | $ mkdir b |
|
223 | $ mkdir b | |
194 | $ echo b > b/b |
|
224 | $ echo b > b/b | |
195 |
|
225 | |||
196 | should fail - no arguments |
|
226 | call `hg revert` with no file specified | |
|
227 | --------------------------------------- | |||
197 |
|
228 | |||
198 | $ hg revert -rtip |
|
229 | $ hg revert -rtip | |
199 | abort: no files or directories specified |
|
230 | abort: no files or directories specified | |
200 | (use --all to revert all files, or 'hg update 1' to update) |
|
231 | (use --all to revert all files, or 'hg update 1' to update) | |
201 | [255] |
|
232 | [255] | |
202 |
|
233 | |||
203 | should succeed |
|
234 | call `hg revert` with --all | |
|
235 | --------------------------- | |||
204 |
|
236 | |||
205 | $ hg revert --all -rtip |
|
237 | $ hg revert --all -rtip | |
206 | reverting a |
|
238 | reverting a | |
207 |
|
239 | |||
208 |
|
240 | |||
209 | Issue332: confusing message when reverting directory |
|
241 | Issue332: confusing message when reverting directory | |
|
242 | ---------------------------------------------------- | |||
210 |
|
243 | |||
211 | $ hg ci -A -m b |
|
244 | $ hg ci -A -m b | |
212 | adding b/b |
|
245 | adding b/b | |
@@ -224,6 +257,7 b' Issue332: confusing message when reverti' | |||||
224 |
|
257 | |||
225 |
|
258 | |||
226 | reverting a rename target should revert the source |
|
259 | reverting a rename target should revert the source | |
|
260 | -------------------------------------------------- | |||
227 |
|
261 | |||
228 | $ hg mv a newa |
|
262 | $ hg mv a newa | |
229 | $ hg revert newa |
|
263 | $ hg revert newa | |
@@ -258,6 +292,7 b' 4 ignored files (we will add/commit ever' | |||||
258 | $ hg rm removed ignoreddir/removed |
|
292 | $ hg rm removed ignoreddir/removed | |
259 |
|
293 | |||
260 | should revert ignored* and undelete *removed |
|
294 | should revert ignored* and undelete *removed | |
|
295 | -------------------------------------------- | |||
261 |
|
296 | |||
262 | $ hg revert -a --no-backup |
|
297 | $ hg revert -a --no-backup | |
263 | reverting ignored |
|
298 | reverting ignored | |
@@ -271,10 +306,14 b' should revert ignored* and undelete *rem' | |||||
271 | $ hg rm removed |
|
306 | $ hg rm removed | |
272 |
|
307 | |||
273 | should silently revert the named files |
|
308 | should silently revert the named files | |
|
309 | -------------------------------------- | |||
274 |
|
310 | |||
275 | $ hg revert --no-backup ignored removed |
|
311 | $ hg revert --no-backup ignored removed | |
276 | $ hg st -mardi |
|
312 | $ hg st -mardi | |
277 |
|
313 | |||
|
314 | Reverting copy (issue3920) | |||
|
315 | -------------------------- | |||
|
316 | ||||
278 | someone set up us the copies |
|
317 | someone set up us the copies | |
279 |
|
318 | |||
280 | $ rm .hgignore |
|
319 | $ rm .hgignore | |
@@ -300,8 +339,9 b' copies and renames, you have no chance t' | |||||
300 | R ignored |
|
339 | R ignored | |
301 |
|
340 | |||
302 | Test revert of a file added by one side of the merge |
|
341 | Test revert of a file added by one side of the merge | |
|
342 | ==================================================== | |||
303 |
|
343 | |||
304 |
|
|
344 | remove any pending change | |
305 |
|
345 | |||
306 |
$ |
|
346 | $ hg revert --all | |
307 | forgetting allyour |
|
347 | forgetting allyour | |
@@ -309,7 +349,7 b' Test revert of a file added by one side ' | |||||
309 | undeleting ignored |
|
349 | undeleting ignored | |
310 | $ hg purge --all --config extensions.purge= |
|
350 | $ hg purge --all --config extensions.purge= | |
311 |
|
351 | |||
312 |
|
|
352 | Adds a new commit | |
313 |
|
353 | |||
314 |
$ |
|
354 | $ echo foo > newadd | |
315 | $ hg add newadd |
|
355 | $ hg add newadd | |
@@ -317,7 +357,7 b' Test revert of a file added by one side ' | |||||
317 | created new head |
|
357 | created new head | |
318 |
|
358 | |||
319 |
|
359 | |||
320 |
|
|
360 | merge it with the other head | |
321 |
|
361 | |||
322 |
$ |
|
362 | $ hg merge # merge 1 into 2 | |
323 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
363 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
@@ -331,7 +371,7 b' Test revert of a file added by one side ' | |||||
331 | commit: 2 modified, 1 removed (merge) |
|
371 | commit: 2 modified, 1 removed (merge) | |
332 | update: (current) |
|
372 | update: (current) | |
333 |
|
373 | |||
334 |
|
|
374 | clarifies who added what | |
335 |
|
375 | |||
336 | $ hg status |
|
376 | $ hg status | |
337 | M allyour |
|
377 | M allyour | |
@@ -344,7 +384,8 b' Test revert of a file added by one side ' | |||||
344 | A base |
|
384 | A base | |
345 | R ignored |
|
385 | R ignored | |
346 |
|
386 | |||
347 |
|
|
387 | revert file added by p1() to p1() state | |
|
388 | ----------------------------------------- | |||
348 |
|
389 | |||
349 | $ hg revert -r 'p1()' 'glob:newad?' |
|
390 | $ hg revert -r 'p1()' 'glob:newad?' | |
350 | $ hg status |
|
391 | $ hg status | |
@@ -352,7 +393,8 b' Test revert of a file added by one side ' | |||||
352 | M base |
|
393 | M base | |
353 | R ignored |
|
394 | R ignored | |
354 |
|
395 | |||
355 |
|
|
396 | revert file added by p1() to p2() state | |
|
397 | ------------------------------------------ | |||
356 |
|
398 | |||
357 | $ hg revert -r 'p2()' 'glob:newad?' |
|
399 | $ hg revert -r 'p2()' 'glob:newad?' | |
358 | removing newadd |
|
400 | removing newadd | |
@@ -362,7 +404,8 b' Test revert of a file added by one side ' | |||||
362 | R ignored |
|
404 | R ignored | |
363 | R newadd |
|
405 | R newadd | |
364 |
|
406 | |||
365 |
|
|
407 | revert file added by p2() to p2() state | |
|
408 | ------------------------------------------ | |||
366 |
|
409 | |||
367 | $ hg revert -r 'p2()' 'glob:allyou?' |
|
410 | $ hg revert -r 'p2()' 'glob:allyou?' | |
368 | $ hg status |
|
411 | $ hg status | |
@@ -371,7 +414,8 b' Test revert of a file added by one side ' | |||||
371 | R ignored |
|
414 | R ignored | |
372 | R newadd |
|
415 | R newadd | |
373 |
|
416 | |||
374 |
|
|
417 | revert file added by p2() to p1() state | |
|
418 | ------------------------------------------ | |||
375 |
|
419 | |||
376 | $ hg revert -r 'p1()' 'glob:allyou?' |
|
420 | $ hg revert -r 'p1()' 'glob:allyou?' | |
377 | removing allyour |
|
421 | removing allyour |
General Comments 0
You need to be logged in to leave comments.
Login now