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