##// END OF EJS Templates
py3: use print as a function in tests/test-revert.t...
Pulkit Goyal -
r39776:e0a7cfa9 default
parent child Browse files
Show More
@@ -1,569 +1,570 b''
1 1 test-abort-checkin.t
2 2 test-absorb-filefixupstate.py
3 3 test-absorb-phase.t
4 4 test-absorb-strip.t
5 5 test-add.t
6 6 test-addremove-similar.t
7 7 test-addremove.t
8 8 test-alias.t
9 9 test-amend-subrepo.t
10 10 test-amend.t
11 11 test-ancestor.py
12 12 test-annotate.py
13 13 test-annotate.t
14 14 test-archive-symlinks.t
15 15 test-atomictempfile.py
16 16 test-audit-path.t
17 17 test-audit-subrepo.t
18 18 test-automv.t
19 19 test-backout.t
20 20 test-backwards-remove.t
21 21 test-bad-pull.t
22 22 test-basic.t
23 23 test-bheads.t
24 24 test-bisect.t
25 25 test-bisect2.t
26 26 test-bisect3.t
27 27 test-blackbox.t
28 28 test-bookmarks-current.t
29 29 test-bookmarks-merge.t
30 30 test-bookmarks-pushpull.t
31 31 test-bookmarks-rebase.t
32 32 test-bookmarks-strip.t
33 33 test-bookmarks.t
34 34 test-branch-change.t
35 35 test-branch-option.t
36 36 test-branch-tag-confict.t
37 37 test-branches.t
38 38 test-bundle-phases.t
39 39 test-bundle-r.t
40 40 test-bundle-type.t
41 41 test-bundle-vs-outgoing.t
42 42 test-bundle.t
43 43 test-bundle2-exchange.t
44 44 test-bundle2-format.t
45 45 test-bundle2-multiple-changegroups.t
46 46 test-bundle2-pushback.t
47 47 test-bundle2-remote-changegroup.t
48 48 test-cappedreader.py
49 49 test-casecollision.t
50 50 test-cat.t
51 51 test-cbor.py
52 52 test-censor.t
53 53 test-changelog-exec.t
54 54 test-check-code.t
55 55 test-check-commit.t
56 56 test-check-execute.t
57 57 test-check-interfaces.py
58 58 test-check-module-imports.t
59 59 test-check-py3-compat.t
60 60 test-check-pyflakes.t
61 61 test-check-pylint.t
62 62 test-check-shbang.t
63 63 test-children.t
64 64 test-clone-cgi.t
65 65 test-clone-pull-corruption.t
66 66 test-clone-r.t
67 67 test-clone-update-order.t
68 68 test-clonebundles.t
69 69 test-commit-amend.t
70 70 test-commit-interactive.t
71 71 test-commit-multiple.t
72 72 test-commit-unresolved.t
73 73 test-commit.t
74 74 test-committer.t
75 75 test-completion.t
76 76 test-config-env.py
77 77 test-config.t
78 78 test-conflict.t
79 79 test-confused-revert.t
80 80 test-context.py
81 81 test-contrib-check-code.t
82 82 test-contrib-check-commit.t
83 83 test-convert-authormap.t
84 84 test-convert-clonebranches.t
85 85 test-convert-cvs-branch.t
86 86 test-convert-cvs-detectmerge.t
87 87 test-convert-cvs-synthetic.t
88 88 test-convert-cvs.t
89 89 test-convert-cvsnt-mergepoints.t
90 90 test-convert-datesort.t
91 91 test-convert-filemap.t
92 92 test-convert-hg-sink.t
93 93 test-convert-hg-source.t
94 94 test-convert-hg-startrev.t
95 95 test-convert-splicemap.t
96 96 test-convert-tagsbranch-topology.t
97 97 test-copy-move-merge.t
98 98 test-copy.t
99 99 test-copytrace-heuristics.t
100 100 test-debugbuilddag.t
101 101 test-debugbundle.t
102 102 test-debugextensions.t
103 103 test-debugindexdot.t
104 104 test-debugrename.t
105 105 test-default-push.t
106 106 test-diff-antipatience.t
107 107 test-diff-binary-file.t
108 108 test-diff-change.t
109 109 test-diff-copy-depth.t
110 110 test-diff-hashes.t
111 111 test-diff-ignore-whitespace.t
112 112 test-diff-indent-heuristic.t
113 113 test-diff-issue2761.t
114 114 test-diff-newlines.t
115 115 test-diff-reverse.t
116 116 test-diff-subdir.t
117 117 test-diff-unified.t
118 118 test-diff-upgrade.t
119 119 test-diffdir.t
120 120 test-diffstat.t
121 121 test-directaccess.t
122 122 test-dirstate-backup.t
123 123 test-dirstate-nonnormalset.t
124 124 test-dirstate.t
125 125 test-dispatch.py
126 126 test-doctest.py
127 127 test-double-merge.t
128 128 test-drawdag.t
129 129 test-duplicateoptions.py
130 130 test-editor-filename.t
131 131 test-empty-dir.t
132 132 test-empty-file.t
133 133 test-empty-group.t
134 134 test-empty.t
135 135 test-encode.t
136 136 test-encoding-func.py
137 137 test-encoding.t
138 138 test-eol-add.t
139 139 test-eol-clone.t
140 140 test-eol-hook.t
141 141 test-eol-patch.t
142 142 test-eol-tag.t
143 143 test-eol-update.t
144 144 test-eol.t
145 145 test-eolfilename.t
146 146 test-excessive-merge.t
147 147 test-exchange-obsmarkers-case-A1.t
148 148 test-exchange-obsmarkers-case-A2.t
149 149 test-exchange-obsmarkers-case-A3.t
150 150 test-exchange-obsmarkers-case-A4.t
151 151 test-exchange-obsmarkers-case-A5.t
152 152 test-exchange-obsmarkers-case-A6.t
153 153 test-exchange-obsmarkers-case-A7.t
154 154 test-exchange-obsmarkers-case-B1.t
155 155 test-exchange-obsmarkers-case-B2.t
156 156 test-exchange-obsmarkers-case-B3.t
157 157 test-exchange-obsmarkers-case-B4.t
158 158 test-exchange-obsmarkers-case-B5.t
159 159 test-exchange-obsmarkers-case-B6.t
160 160 test-exchange-obsmarkers-case-B7.t
161 161 test-exchange-obsmarkers-case-C1.t
162 162 test-exchange-obsmarkers-case-C2.t
163 163 test-exchange-obsmarkers-case-C3.t
164 164 test-exchange-obsmarkers-case-C4.t
165 165 test-exchange-obsmarkers-case-D1.t
166 166 test-exchange-obsmarkers-case-D2.t
167 167 test-exchange-obsmarkers-case-D3.t
168 168 test-exchange-obsmarkers-case-D4.t
169 169 test-execute-bit.t
170 170 test-export.t
171 171 test-extdata.t
172 172 test-extdiff.t
173 173 test-extensions-afterloaded.t
174 174 test-extensions-wrapfunction.py
175 175 test-extra-filelog-entry.t
176 176 test-fetch.t
177 177 test-filebranch.t
178 178 test-filecache.py
179 179 test-filelog.py
180 180 test-fileset-generated.t
181 181 test-fileset.t
182 182 test-fix-topology.t
183 183 test-flags.t
184 184 test-generaldelta.t
185 185 test-getbundle.t
186 186 test-git-export.t
187 187 test-glog-beautifygraph.t
188 188 test-glog-topological.t
189 189 test-glog.t
190 190 test-gpg.t
191 191 test-graft.t
192 192 test-grep.t
193 193 test-hg-parseurl.py
194 194 test-hghave.t
195 195 test-hgignore.t
196 196 test-hgk.t
197 197 test-hgrc.t
198 198 test-hgweb-bundle.t
199 199 test-hgweb-descend-empties.t
200 200 test-hgweb-empty.t
201 201 test-hgweb-removed.t
202 202 test-hgwebdir-paths.py
203 203 test-hgwebdirsym.t
204 204 test-histedit-arguments.t
205 205 test-histedit-base.t
206 206 test-histedit-bookmark-motion.t
207 207 test-histedit-commute.t
208 208 test-histedit-drop.t
209 209 test-histedit-edit.t
210 210 test-histedit-fold-non-commute.t
211 211 test-histedit-fold.t
212 212 test-histedit-no-backup.t
213 213 test-histedit-no-change.t
214 214 test-histedit-non-commute-abort.t
215 215 test-histedit-non-commute.t
216 216 test-histedit-obsolete.t
217 217 test-histedit-outgoing.t
218 218 test-histedit-templates.t
219 219 test-http-branchmap.t
220 220 test-http-bundle1.t
221 221 test-http-clone-r.t
222 222 test-http-permissions.t
223 223 test-http.t
224 224 test-hybridencode.py
225 225 test-identify.t
226 226 test-impexp-branch.t
227 227 test-import-bypass.t
228 228 test-import-eol.t
229 229 test-import-merge.t
230 230 test-import-unknown.t
231 231 test-import.t
232 232 test-imports-checker.t
233 233 test-incoming-outgoing.t
234 234 test-inherit-mode.t
235 235 test-init.t
236 236 test-issue1089.t
237 237 test-issue1102.t
238 238 test-issue1175.t
239 239 test-issue1306.t
240 240 test-issue1438.t
241 241 test-issue1502.t
242 242 test-issue1802.t
243 243 test-issue1877.t
244 244 test-issue1993.t
245 245 test-issue2137.t
246 246 test-issue3084.t
247 247 test-issue4074.t
248 248 test-issue522.t
249 249 test-issue586.t
250 250 test-issue5979.t
251 251 test-issue612.t
252 252 test-issue619.t
253 253 test-issue660.t
254 254 test-issue672.t
255 255 test-issue842.t
256 256 test-journal-exists.t
257 257 test-journal-share.t
258 258 test-journal.t
259 259 test-known.t
260 260 test-largefiles-cache.t
261 261 test-largefiles-misc.t
262 262 test-largefiles-small-disk.t
263 263 test-largefiles-update.t
264 264 test-largefiles.t
265 265 test-lfs-largefiles.t
266 266 test-lfs-pointer.py
267 267 test-linelog.py
268 268 test-linerange.py
269 269 test-locate.t
270 270 test-lock-badness.t
271 271 test-log-linerange.t
272 272 test-log.t
273 273 test-logexchange.t
274 274 test-lrucachedict.py
275 275 test-mactext.t
276 276 test-mailmap.t
277 277 test-manifest-merging.t
278 278 test-manifest.py
279 279 test-manifest.t
280 280 test-match.py
281 281 test-mdiff.py
282 282 test-merge-changedelete.t
283 283 test-merge-closedheads.t
284 284 test-merge-commit.t
285 285 test-merge-criss-cross.t
286 286 test-merge-default.t
287 287 test-merge-force.t
288 288 test-merge-halt.t
289 289 test-merge-internal-tools-pattern.t
290 290 test-merge-local.t
291 291 test-merge-no-file-change.t
292 292 test-merge-remove.t
293 293 test-merge-revert.t
294 294 test-merge-revert2.t
295 295 test-merge-subrepos.t
296 296 test-merge-symlinks.t
297 297 test-merge-tools.t
298 298 test-merge-types.t
299 299 test-merge1.t
300 300 test-merge10.t
301 301 test-merge2.t
302 302 test-merge4.t
303 303 test-merge5.t
304 304 test-merge6.t
305 305 test-merge7.t
306 306 test-merge8.t
307 307 test-merge9.t
308 308 test-minifileset.py
309 309 test-minirst.py
310 310 test-mq-git.t
311 311 test-mq-guards.t
312 312 test-mq-header-date.t
313 313 test-mq-header-from.t
314 314 test-mq-merge.t
315 315 test-mq-pull-from-bundle.t
316 316 test-mq-qclone-http.t
317 317 test-mq-qdelete.t
318 318 test-mq-qdiff.t
319 319 test-mq-qfold.t
320 320 test-mq-qgoto.t
321 321 test-mq-qimport-fail-cleanup.t
322 322 test-mq-qnew.t
323 323 test-mq-qpush-exact.t
324 324 test-mq-qpush-fail.t
325 325 test-mq-qqueue.t
326 326 test-mq-qrefresh-interactive.t
327 327 test-mq-qrefresh-replace-log-message.t
328 328 test-mq-qrefresh.t
329 329 test-mq-qrename.t
330 330 test-mq-qsave.t
331 331 test-mq-safety.t
332 332 test-mq-subrepo.t
333 333 test-mq-symlinks.t
334 334 test-mq.t
335 335 test-mv-cp-st-diff.t
336 336 test-narrow-acl.t
337 337 test-narrow-archive.t
338 338 test-narrow-clone-no-ellipsis.t
339 339 test-narrow-clone-non-narrow-server.t
340 340 test-narrow-clone-nonlinear.t
341 341 test-narrow-clone.t
342 342 test-narrow-commit.t
343 343 test-narrow-copies.t
344 344 test-narrow-debugcommands.t
345 345 test-narrow-debugrebuilddirstate.t
346 346 test-narrow-exchange-merges.t
347 347 test-narrow-exchange.t
348 348 test-narrow-expanddirstate.t
349 349 test-narrow-merge.t
350 350 test-narrow-patch.t
351 351 test-narrow-patterns.t
352 352 test-narrow-pull.t
353 353 test-narrow-rebase.t
354 354 test-narrow-shallow-merges.t
355 355 test-narrow-shallow.t
356 356 test-narrow-strip.t
357 357 test-narrow-trackedcmd.t
358 358 test-narrow-update.t
359 359 test-narrow-widen-no-ellipsis.t
360 360 test-narrow-widen.t
361 361 test-narrow.t
362 362 test-nested-repo.t
363 363 test-newbranch.t
364 364 test-nointerrupt.t
365 365 test-obshistory.t
366 366 test-obsmarker-template.t
367 367 test-obsmarkers-effectflag.t
368 368 test-obsolete-bounds-checking.t
369 369 test-obsolete-bundle-strip.t
370 370 test-obsolete-changeset-exchange.t
371 371 test-obsolete-checkheads.t
372 372 test-obsolete-distributed.t
373 373 test-obsolete-divergent.t
374 374 test-obsolete-tag-cache.t
375 375 test-pager.t
376 376 test-parents.t
377 377 test-parseindex2.py
378 378 test-patch-offset.t
379 379 test-patch.t
380 380 test-patchbomb-bookmark.t
381 381 test-patchbomb-tls.t
382 382 test-patchbomb.t
383 383 test-pathconflicts-merge.t
384 384 test-pathconflicts-update.t
385 385 test-pathencode.py
386 386 test-pending.t
387 387 test-permissions.t
388 388 test-phases.t
389 389 test-pull-branch.t
390 390 test-pull-http.t
391 391 test-pull-permission.t
392 392 test-pull-pull-corruption.t
393 393 test-pull-r.t
394 394 test-pull-update.t
395 395 test-pull.t
396 396 test-purge.t
397 397 test-push-cgi.t
398 398 test-push-checkheads-partial-C1.t
399 399 test-push-checkheads-partial-C2.t
400 400 test-push-checkheads-partial-C3.t
401 401 test-push-checkheads-partial-C4.t
402 402 test-push-checkheads-pruned-B1.t
403 403 test-push-checkheads-pruned-B2.t
404 404 test-push-checkheads-pruned-B3.t
405 405 test-push-checkheads-pruned-B4.t
406 406 test-push-checkheads-pruned-B5.t
407 407 test-push-checkheads-pruned-B6.t
408 408 test-push-checkheads-pruned-B7.t
409 409 test-push-checkheads-pruned-B8.t
410 410 test-push-checkheads-superceed-A1.t
411 411 test-push-checkheads-superceed-A2.t
412 412 test-push-checkheads-superceed-A3.t
413 413 test-push-checkheads-superceed-A4.t
414 414 test-push-checkheads-superceed-A5.t
415 415 test-push-checkheads-superceed-A6.t
416 416 test-push-checkheads-superceed-A7.t
417 417 test-push-checkheads-superceed-A8.t
418 418 test-push-checkheads-unpushed-D1.t
419 419 test-push-checkheads-unpushed-D2.t
420 420 test-push-checkheads-unpushed-D3.t
421 421 test-push-checkheads-unpushed-D4.t
422 422 test-push-checkheads-unpushed-D5.t
423 423 test-push-checkheads-unpushed-D6.t
424 424 test-push-checkheads-unpushed-D7.t
425 425 test-push-http.t
426 426 test-push-warn.t
427 427 test-push.t
428 428 test-pushvars.t
429 429 test-qrecord.t
430 430 test-rebase-abort.t
431 431 test-rebase-backup.t
432 432 test-rebase-base-flag.t
433 433 test-rebase-bookmarks.t
434 434 test-rebase-brute-force.t
435 435 test-rebase-cache.t
436 436 test-rebase-check-restore.t
437 437 test-rebase-collapse.t
438 438 test-rebase-conflicts.t
439 439 test-rebase-dest.t
440 440 test-rebase-detach.t
441 441 test-rebase-emptycommit.t
442 442 test-rebase-inmemory.t
443 443 test-rebase-interruptions.t
444 444 test-rebase-issue-noparam-single-rev.t
445 445 test-rebase-legacy.t
446 446 test-rebase-mq-skip.t
447 447 test-rebase-mq.t
448 448 test-rebase-named-branches.t
449 449 test-rebase-newancestor.t
450 450 test-rebase-obsolete.t
451 451 test-rebase-parameters.t
452 452 test-rebase-partial.t
453 453 test-rebase-pull.t
454 454 test-rebase-rename.t
455 455 test-rebase-scenario-global.t
456 456 test-rebase-templates.t
457 457 test-rebase-transaction.t
458 458 test-rebuildstate.t
459 459 test-record.t
460 460 test-relink.t
461 461 test-remove.t
462 462 test-removeemptydirs.t
463 463 test-rename-after-merge.t
464 464 test-rename-dir-merge.t
465 465 test-rename-merge1.t
466 466 test-rename-merge2.t
467 467 test-rename.t
468 468 test-repair-strip.t
469 469 test-repo-compengines.t
470 470 test-resolve.t
471 471 test-revert-flags.t
472 472 test-revert-interactive.t
473 473 test-revert-unknown.t
474 test-revert.t
474 475 test-revisions.t
475 476 test-revlog-ancestry.py
476 477 test-revlog-group-emptyiter.t
477 478 test-revlog-mmapindex.t
478 479 test-revlog-packentry.t
479 480 test-revlog-raw.py
480 481 test-revlog-v2.t
481 482 test-revset-dirstate-parents.t
482 483 test-revset-legacy-lookup.t
483 484 test-revset-outgoing.t
484 485 test-rollback.t
485 486 test-run-tests.py
486 487 test-run-tests.t
487 488 test-schemes.t
488 489 test-serve.t
489 490 test-setdiscovery.t
490 491 test-share.t
491 492 test-shelve.t
492 493 test-show-stack.t
493 494 test-show-work.t
494 495 test-show.t
495 496 test-simple-update.t
496 497 test-simplekeyvaluefile.py
497 498 test-simplemerge.py
498 499 test-single-head.t
499 500 test-sparse-clear.t
500 501 test-sparse-clone.t
501 502 test-sparse-import.t
502 503 test-sparse-merges.t
503 504 test-sparse-profiles.t
504 505 test-sparse-requirement.t
505 506 test-sparse-verbose-json.t
506 507 test-sparse.t
507 508 test-split.t
508 509 test-ssh-bundle1.t
509 510 test-ssh-clone-r.t
510 511 test-ssh-proto-unbundle.t
511 512 test-ssh-proto.t
512 513 test-ssh.t
513 514 test-sshserver.py
514 515 test-stack.t
515 516 test-status-inprocess.py
516 517 test-status-rev.t
517 518 test-status-terse.t
518 519 test-strict.t
519 520 test-strip-cross.t
520 521 test-strip.t
521 522 test-subrepo-deep-nested-change.t
522 523 test-subrepo-missing.t
523 524 test-subrepo-paths.t
524 525 test-subrepo-recursion.t
525 526 test-subrepo-relative-path.t
526 527 test-subrepo.t
527 528 test-symlink-os-yes-fs-no.py
528 529 test-symlink-placeholder.t
529 530 test-symlinks.t
530 531 test-tag.t
531 532 test-tags.t
532 533 test-template-basic.t
533 534 test-template-functions.t
534 535 test-template-keywords.t
535 536 test-template-map.t
536 537 test-transplant.t
537 538 test-treemanifest.t
538 539 test-ui-color.py
539 540 test-ui-config.py
540 541 test-ui-verbosity.py
541 542 test-unamend.t
542 543 test-unbundlehash.t
543 544 test-uncommit.t
544 545 test-unified-test.t
545 546 test-unionrepo.t
546 547 test-unrelated-pull.t
547 548 test-up-local-change.t
548 549 test-update-branches.t
549 550 test-update-dest.t
550 551 test-update-issue1456.t
551 552 test-update-names.t
552 553 test-update-reverse.t
553 554 test-upgrade-repo.t
554 555 test-url-download.t
555 556 test-url-rev.t
556 557 test-url.py
557 558 test-username-newline.t
558 559 test-util.py
559 560 test-verify.t
560 561 test-walk.t
561 562 test-walkrepo.py
562 563 test-websub.t
563 564 test-win32text.t
564 565 test-wireproto-clientreactor.py
565 566 test-wireproto-framing.py
566 567 test-wireproto-serverreactor.py
567 568 test-wireproto.py
568 569 test-wsgirequest.py
569 570 test-xdg.t
@@ -1,1147 +1,1148 b''
1 1 $ hg init repo
2 2 $ cd repo
3 3 $ echo 123 > a
4 4 $ echo 123 > c
5 5 $ echo 123 > e
6 6 $ hg add a c e
7 7 $ hg commit -m "first" a c e
8 8
9 9 nothing changed
10 10
11 11 $ hg revert
12 12 abort: no files or directories specified
13 13 (use --all to revert all files)
14 14 [255]
15 15 $ hg revert --all
16 16
17 17 Introduce some changes and revert them
18 18 --------------------------------------
19 19
20 20 $ echo 123 > b
21 21
22 22 $ hg status
23 23 ? b
24 24 $ echo 12 > c
25 25
26 26 $ hg status
27 27 M c
28 28 ? b
29 29 $ hg add b
30 30
31 31 $ hg status
32 32 M c
33 33 A b
34 34 $ hg rm a
35 35
36 36 $ hg status
37 37 M c
38 38 A b
39 39 R a
40 40
41 41 revert removal of a file
42 42
43 43 $ hg revert a
44 44 $ hg status
45 45 M c
46 46 A b
47 47
48 48 revert addition of a file
49 49
50 50 $ hg revert b
51 51 $ hg status
52 52 M c
53 53 ? b
54 54
55 55 revert modification of a file (--no-backup)
56 56
57 57 $ hg revert --no-backup c
58 58 $ hg status
59 59 ? b
60 60
61 61 revert deletion (! status) of a added file
62 62 ------------------------------------------
63 63
64 64 $ hg add b
65 65
66 66 $ hg status b
67 67 A b
68 68 $ rm b
69 69 $ hg status b
70 70 ! b
71 71 $ hg revert -v b
72 72 forgetting b
73 73 $ hg status b
74 74 b: * (glob)
75 75
76 76 $ ls
77 77 a
78 78 c
79 79 e
80 80
81 81 Test creation of backup (.orig) files
82 82 -------------------------------------
83 83
84 84 $ echo z > e
85 85 $ hg revert --all -v
86 86 saving current version of e as e.orig
87 87 reverting e
88 88
89 89 Test creation of backup (.orig) file in configured file location
90 90 ----------------------------------------------------------------
91 91
92 92 $ echo z > e
93 93 $ hg revert --all -v --config 'ui.origbackuppath=.hg/origbackups'
94 94 creating directory: $TESTTMP/repo/.hg/origbackups
95 95 saving current version of e as $TESTTMP/repo/.hg/origbackups/e
96 96 reverting e
97 97 $ rm -rf .hg/origbackups
98 98
99 99 revert on clean file (no change)
100 100 --------------------------------
101 101
102 102 $ hg revert a
103 103 no changes needed to a
104 104
105 105 revert on an untracked file
106 106 ---------------------------
107 107
108 108 $ echo q > q
109 109 $ hg revert q
110 110 file not managed: q
111 111 $ rm q
112 112
113 113 revert on file that does not exists
114 114 -----------------------------------
115 115
116 116 $ hg revert notfound
117 117 notfound: no such file in rev 334a9e57682c
118 118 $ touch d
119 119 $ hg add d
120 120 $ hg rm a
121 121 $ hg commit -m "second"
122 122 $ echo z > z
123 123 $ hg add z
124 124 $ hg st
125 125 A z
126 126 ? e.orig
127 127
128 128 revert to another revision (--rev)
129 129 ----------------------------------
130 130
131 131 $ hg revert --all -r0
132 132 forgetting z
133 133 removing d
134 134 adding a
135 135
136 136 revert explicitly to parent (--rev)
137 137 -----------------------------------
138 138
139 139 $ hg revert --all -rtip
140 140 forgetting a
141 141 undeleting d
142 142 $ rm a *.orig
143 143
144 144 revert to another revision (--rev) and exact match
145 145 --------------------------------------------------
146 146
147 147 exact match are more silent
148 148
149 149 $ hg revert -r0 a
150 150 $ hg st a
151 151 A a
152 152 $ hg rm d
153 153 $ hg st d
154 154 R d
155 155
156 156 should keep d removed
157 157
158 158 $ hg revert -r0 d
159 159 no changes needed to d
160 160 $ hg st d
161 161 R d
162 162
163 163 $ hg update -C
164 164 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 165
166 166 revert of exec bit
167 167 ------------------
168 168
169 169 #if execbit
170 170 $ chmod +x c
171 171 $ hg revert --all
172 172 reverting c
173 173
174 174 $ test -x c || echo non-executable
175 175 non-executable
176 176
177 177 $ chmod +x c
178 178 $ hg commit -m exe
179 179
180 180 $ chmod -x c
181 181 $ hg revert --all
182 182 reverting c
183 183
184 184 $ test -x c && echo executable
185 185 executable
186 186 #endif
187 187
188 188 Test that files reverted to other than the parent are treated as
189 189 "modified", even if none of mode, size and timestamp of it isn't
190 190 changed on the filesystem (see also issue4583).
191 191
192 192 $ echo 321 > e
193 193 $ hg diff --git
194 194 diff --git a/e b/e
195 195 --- a/e
196 196 +++ b/e
197 197 @@ -1,1 +1,1 @@
198 198 -123
199 199 +321
200 200 $ hg commit -m 'ambiguity from size'
201 201
202 202 $ cat e
203 203 321
204 204 $ touch -t 200001010000 e
205 205 $ hg debugrebuildstate
206 206
207 207 $ cat >> .hg/hgrc <<EOF
208 208 > [fakedirstatewritetime]
209 209 > # emulate invoking dirstate.write() via repo.status()
210 210 > # at 2000-01-01 00:00
211 211 > fakenow = 200001010000
212 212 >
213 213 > [extensions]
214 214 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
215 215 > EOF
216 216 $ hg revert -r 0 e
217 217 $ cat >> .hg/hgrc <<EOF
218 218 > [extensions]
219 219 > fakedirstatewritetime = !
220 220 > EOF
221 221
222 222 $ cat e
223 223 123
224 224 $ touch -t 200001010000 e
225 225 $ hg status -A e
226 226 M e
227 227
228 228 $ cd ..
229 229
230 230
231 231 Issue241: update and revert produces inconsistent repositories
232 232 --------------------------------------------------------------
233 233
234 234 $ hg init a
235 235 $ cd a
236 236 $ echo a >> a
237 237 $ hg commit -A -d '1 0' -m a
238 238 adding a
239 239 $ echo a >> a
240 240 $ hg commit -d '2 0' -m a
241 241 $ hg update 0
242 242 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 243 $ mkdir b
244 244 $ echo b > b/b
245 245
246 246 call `hg revert` with no file specified
247 247 ---------------------------------------
248 248
249 249 $ hg revert -rtip
250 250 abort: no files or directories specified
251 251 (use --all to revert all files, or 'hg update 1' to update)
252 252 [255]
253 253
254 254 call `hg revert` with -I
255 255 ---------------------------
256 256
257 257 $ echo a >> a
258 258 $ hg revert -I a
259 259 reverting a
260 260
261 261 call `hg revert` with -X
262 262 ---------------------------
263 263
264 264 $ echo a >> a
265 265 $ hg revert -X d
266 266 reverting a
267 267
268 268 call `hg revert` with --all
269 269 ---------------------------
270 270
271 271 $ hg revert --all -rtip
272 272 reverting a
273 273 $ rm *.orig
274 274
275 275 Issue332: confusing message when reverting directory
276 276 ----------------------------------------------------
277 277
278 278 $ hg ci -A -m b
279 279 adding b/b
280 280 created new head
281 281 $ echo foobar > b/b
282 282 $ mkdir newdir
283 283 $ echo foo > newdir/newfile
284 284 $ hg add newdir/newfile
285 285 $ hg revert b newdir
286 286 forgetting newdir/newfile
287 287 reverting b/b
288 288 $ echo foobar > b/b
289 289 $ hg revert .
290 290 reverting b/b
291 291
292 292
293 293 reverting a rename target should revert the source
294 294 --------------------------------------------------
295 295
296 296 $ hg mv a newa
297 297 $ hg revert newa
298 298 $ hg st a newa
299 299 ? newa
300 300
301 301 Also true for move overwriting an existing file
302 302
303 303 $ hg mv --force a b/b
304 304 $ hg revert b/b
305 305 $ hg status a b/b
306 306
307 307 $ cd ..
308 308
309 309 $ hg init ignored
310 310 $ cd ignored
311 311 $ echo '^ignored$' > .hgignore
312 312 $ echo '^ignoreddir$' >> .hgignore
313 313 $ echo '^removed$' >> .hgignore
314 314
315 315 $ mkdir ignoreddir
316 316 $ touch ignoreddir/file
317 317 $ touch ignoreddir/removed
318 318 $ touch ignored
319 319 $ touch removed
320 320
321 321 4 ignored files (we will add/commit everything)
322 322
323 323 $ hg st -A -X .hgignore
324 324 I ignored
325 325 I ignoreddir/file
326 326 I ignoreddir/removed
327 327 I removed
328 328 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
329 329
330 330 $ echo >> ignored
331 331 $ echo >> ignoreddir/file
332 332 $ hg rm removed ignoreddir/removed
333 333
334 334 should revert ignored* and undelete *removed
335 335 --------------------------------------------
336 336
337 337 $ hg revert -a --no-backup
338 338 reverting ignored
339 339 reverting ignoreddir/file
340 340 undeleting ignoreddir/removed
341 341 undeleting removed
342 342 $ hg st -mardi
343 343
344 344 $ hg up -qC
345 345 $ echo >> ignored
346 346 $ hg rm removed
347 347
348 348 should silently revert the named files
349 349 --------------------------------------
350 350
351 351 $ hg revert --no-backup ignored removed
352 352 $ hg st -mardi
353 353
354 354 Reverting copy (issue3920)
355 355 --------------------------
356 356
357 357 someone set up us the copies
358 358
359 359 $ rm .hgignore
360 360 $ hg update -C
361 361 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 362 $ hg mv ignored allyour
363 363 $ hg copy removed base
364 364 $ hg commit -m rename
365 365
366 366 copies and renames, you have no chance to survive make your time (issue3920)
367 367
368 368 $ hg update '.^'
369 369 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
370 370 $ hg revert -rtip -a
371 371 removing ignored
372 372 adding allyour
373 373 adding base
374 374 $ hg status -C
375 375 A allyour
376 376 ignored
377 377 A base
378 378 removed
379 379 R ignored
380 380
381 381 Test revert of a file added by one side of the merge
382 382 ====================================================
383 383
384 384 remove any pending change
385 385
386 386 $ hg revert --all
387 387 forgetting allyour
388 388 forgetting base
389 389 undeleting ignored
390 390 $ hg purge --all --config extensions.purge=
391 391
392 392 Adds a new commit
393 393
394 394 $ echo foo > newadd
395 395 $ hg add newadd
396 396 $ hg commit -m 'other adds'
397 397 created new head
398 398
399 399
400 400 merge it with the other head
401 401
402 402 $ hg merge # merge 1 into 2
403 403 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
404 404 (branch merge, don't forget to commit)
405 405 $ hg summary
406 406 parent: 2:b8ec310b2d4e tip
407 407 other adds
408 408 parent: 1:f6180deb8fbe
409 409 rename
410 410 branch: default
411 411 commit: 2 modified, 1 removed (merge)
412 412 update: (current)
413 413 phases: 3 draft
414 414
415 415 clarifies who added what
416 416
417 417 $ hg status
418 418 M allyour
419 419 M base
420 420 R ignored
421 421 $ hg status --change 'p1()'
422 422 A newadd
423 423 $ hg status --change 'p2()'
424 424 A allyour
425 425 A base
426 426 R ignored
427 427
428 428 revert file added by p1() to p1() state
429 429 -----------------------------------------
430 430
431 431 $ hg revert -r 'p1()' 'glob:newad?'
432 432 $ hg status
433 433 M allyour
434 434 M base
435 435 R ignored
436 436
437 437 revert file added by p1() to p2() state
438 438 ------------------------------------------
439 439
440 440 $ hg revert -r 'p2()' 'glob:newad?'
441 441 removing newadd
442 442 $ hg status
443 443 M allyour
444 444 M base
445 445 R ignored
446 446 R newadd
447 447
448 448 revert file added by p2() to p2() state
449 449 ------------------------------------------
450 450
451 451 $ hg revert -r 'p2()' 'glob:allyou?'
452 452 $ hg status
453 453 M allyour
454 454 M base
455 455 R ignored
456 456 R newadd
457 457
458 458 revert file added by p2() to p1() state
459 459 ------------------------------------------
460 460
461 461 $ hg revert -r 'p1()' 'glob:allyou?'
462 462 removing allyour
463 463 $ hg status
464 464 M base
465 465 R allyour
466 466 R ignored
467 467 R newadd
468 468
469 469 Systematic behavior validation of most possible cases
470 470 =====================================================
471 471
472 472 This section tests most of the possible combinations of revision states and
473 473 working directory states. The number of possible cases is significant but they
474 474 but they all have a slightly different handling. So this section commits to
475 475 and testing all of them to allow safe refactoring of the revert code.
476 476
477 477 A python script is used to generate a file history for each combination of
478 478 states, on one side the content (or lack thereof) in two revisions, and
479 479 on the other side, the content and "tracked-ness" of the working directory. The
480 480 three states generated are:
481 481
482 482 - a "base" revision
483 483 - a "parent" revision
484 484 - the working directory (based on "parent")
485 485
486 486 The files generated have names of the form:
487 487
488 488 <rev1-content>_<rev2-content>_<working-copy-content>-<tracked-ness>
489 489
490 490 All known states are not tested yet. See inline documentation for details.
491 491 Special cases from merge and rename are not tested by this section.
492 492
493 493 Write the python script to disk
494 494 -------------------------------
495 495
496 496 check list of planned files
497 497
498 498 $ "$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 2
499 499 content1_content1_content1-tracked
500 500 content1_content1_content1-untracked
501 501 content1_content1_content3-tracked
502 502 content1_content1_content3-untracked
503 503 content1_content1_missing-tracked
504 504 content1_content1_missing-untracked
505 505 content1_content2_content1-tracked
506 506 content1_content2_content1-untracked
507 507 content1_content2_content2-tracked
508 508 content1_content2_content2-untracked
509 509 content1_content2_content3-tracked
510 510 content1_content2_content3-untracked
511 511 content1_content2_missing-tracked
512 512 content1_content2_missing-untracked
513 513 content1_missing_content1-tracked
514 514 content1_missing_content1-untracked
515 515 content1_missing_content3-tracked
516 516 content1_missing_content3-untracked
517 517 content1_missing_missing-tracked
518 518 content1_missing_missing-untracked
519 519 missing_content2_content2-tracked
520 520 missing_content2_content2-untracked
521 521 missing_content2_content3-tracked
522 522 missing_content2_content3-untracked
523 523 missing_content2_missing-tracked
524 524 missing_content2_missing-untracked
525 525 missing_missing_content3-tracked
526 526 missing_missing_content3-untracked
527 527 missing_missing_missing-tracked
528 528 missing_missing_missing-untracked
529 529
530 530 Script to make a simple text version of the content
531 531 ---------------------------------------------------
532 532
533 533 $ cat << EOF >> dircontent.py
534 534 > # generate a simple text view of the directory for easy comparison
535 > from __future__ import print_function
535 536 > import os
536 537 > files = os.listdir('.')
537 538 > files.sort()
538 539 > for filename in files:
539 540 > if os.path.isdir(filename):
540 541 > continue
541 542 > content = open(filename).read()
542 > print '%-6s %s' % (content.strip(), filename)
543 > print('%-6s %s' % (content.strip(), filename))
543 544 > EOF
544 545
545 546 Generate appropriate repo state
546 547 -------------------------------
547 548
548 549 $ hg init revert-ref
549 550 $ cd revert-ref
550 551
551 552 Generate base changeset
552 553
553 554 $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 1
554 555 $ hg addremove --similarity 0
555 556 adding content1_content1_content1-tracked
556 557 adding content1_content1_content1-untracked
557 558 adding content1_content1_content3-tracked
558 559 adding content1_content1_content3-untracked
559 560 adding content1_content1_missing-tracked
560 561 adding content1_content1_missing-untracked
561 562 adding content1_content2_content1-tracked
562 563 adding content1_content2_content1-untracked
563 564 adding content1_content2_content2-tracked
564 565 adding content1_content2_content2-untracked
565 566 adding content1_content2_content3-tracked
566 567 adding content1_content2_content3-untracked
567 568 adding content1_content2_missing-tracked
568 569 adding content1_content2_missing-untracked
569 570 adding content1_missing_content1-tracked
570 571 adding content1_missing_content1-untracked
571 572 adding content1_missing_content3-tracked
572 573 adding content1_missing_content3-untracked
573 574 adding content1_missing_missing-tracked
574 575 adding content1_missing_missing-untracked
575 576 $ hg status
576 577 A content1_content1_content1-tracked
577 578 A content1_content1_content1-untracked
578 579 A content1_content1_content3-tracked
579 580 A content1_content1_content3-untracked
580 581 A content1_content1_missing-tracked
581 582 A content1_content1_missing-untracked
582 583 A content1_content2_content1-tracked
583 584 A content1_content2_content1-untracked
584 585 A content1_content2_content2-tracked
585 586 A content1_content2_content2-untracked
586 587 A content1_content2_content3-tracked
587 588 A content1_content2_content3-untracked
588 589 A content1_content2_missing-tracked
589 590 A content1_content2_missing-untracked
590 591 A content1_missing_content1-tracked
591 592 A content1_missing_content1-untracked
592 593 A content1_missing_content3-tracked
593 594 A content1_missing_content3-untracked
594 595 A content1_missing_missing-tracked
595 596 A content1_missing_missing-untracked
596 597 $ hg commit -m 'base'
597 598
598 599 (create a simple text version of the content)
599 600
600 601 $ "$PYTHON" ../dircontent.py > ../content-base.txt
601 602 $ cat ../content-base.txt
602 603 content1 content1_content1_content1-tracked
603 604 content1 content1_content1_content1-untracked
604 605 content1 content1_content1_content3-tracked
605 606 content1 content1_content1_content3-untracked
606 607 content1 content1_content1_missing-tracked
607 608 content1 content1_content1_missing-untracked
608 609 content1 content1_content2_content1-tracked
609 610 content1 content1_content2_content1-untracked
610 611 content1 content1_content2_content2-tracked
611 612 content1 content1_content2_content2-untracked
612 613 content1 content1_content2_content3-tracked
613 614 content1 content1_content2_content3-untracked
614 615 content1 content1_content2_missing-tracked
615 616 content1 content1_content2_missing-untracked
616 617 content1 content1_missing_content1-tracked
617 618 content1 content1_missing_content1-untracked
618 619 content1 content1_missing_content3-tracked
619 620 content1 content1_missing_content3-untracked
620 621 content1 content1_missing_missing-tracked
621 622 content1 content1_missing_missing-untracked
622 623
623 624 Create parent changeset
624 625
625 626 $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 2
626 627 $ hg addremove --similarity 0
627 628 removing content1_missing_content1-tracked
628 629 removing content1_missing_content1-untracked
629 630 removing content1_missing_content3-tracked
630 631 removing content1_missing_content3-untracked
631 632 removing content1_missing_missing-tracked
632 633 removing content1_missing_missing-untracked
633 634 adding missing_content2_content2-tracked
634 635 adding missing_content2_content2-untracked
635 636 adding missing_content2_content3-tracked
636 637 adding missing_content2_content3-untracked
637 638 adding missing_content2_missing-tracked
638 639 adding missing_content2_missing-untracked
639 640 $ hg status
640 641 M content1_content2_content1-tracked
641 642 M content1_content2_content1-untracked
642 643 M content1_content2_content2-tracked
643 644 M content1_content2_content2-untracked
644 645 M content1_content2_content3-tracked
645 646 M content1_content2_content3-untracked
646 647 M content1_content2_missing-tracked
647 648 M content1_content2_missing-untracked
648 649 A missing_content2_content2-tracked
649 650 A missing_content2_content2-untracked
650 651 A missing_content2_content3-tracked
651 652 A missing_content2_content3-untracked
652 653 A missing_content2_missing-tracked
653 654 A missing_content2_missing-untracked
654 655 R content1_missing_content1-tracked
655 656 R content1_missing_content1-untracked
656 657 R content1_missing_content3-tracked
657 658 R content1_missing_content3-untracked
658 659 R content1_missing_missing-tracked
659 660 R content1_missing_missing-untracked
660 661 $ hg commit -m 'parent'
661 662
662 663 (create a simple text version of the content)
663 664
664 665 $ "$PYTHON" ../dircontent.py > ../content-parent.txt
665 666 $ cat ../content-parent.txt
666 667 content1 content1_content1_content1-tracked
667 668 content1 content1_content1_content1-untracked
668 669 content1 content1_content1_content3-tracked
669 670 content1 content1_content1_content3-untracked
670 671 content1 content1_content1_missing-tracked
671 672 content1 content1_content1_missing-untracked
672 673 content2 content1_content2_content1-tracked
673 674 content2 content1_content2_content1-untracked
674 675 content2 content1_content2_content2-tracked
675 676 content2 content1_content2_content2-untracked
676 677 content2 content1_content2_content3-tracked
677 678 content2 content1_content2_content3-untracked
678 679 content2 content1_content2_missing-tracked
679 680 content2 content1_content2_missing-untracked
680 681 content2 missing_content2_content2-tracked
681 682 content2 missing_content2_content2-untracked
682 683 content2 missing_content2_content3-tracked
683 684 content2 missing_content2_content3-untracked
684 685 content2 missing_content2_missing-tracked
685 686 content2 missing_content2_missing-untracked
686 687
687 688 Setup working directory
688 689
689 690 $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 wc
690 691 $ hg addremove --similarity 0
691 692 adding content1_missing_content1-tracked
692 693 adding content1_missing_content1-untracked
693 694 adding content1_missing_content3-tracked
694 695 adding content1_missing_content3-untracked
695 696 adding content1_missing_missing-tracked
696 697 adding content1_missing_missing-untracked
697 698 adding missing_missing_content3-tracked
698 699 adding missing_missing_content3-untracked
699 700 adding missing_missing_missing-tracked
700 701 adding missing_missing_missing-untracked
701 702 $ hg forget *_*_*-untracked
702 703 $ rm *_*_missing-*
703 704 $ hg status
704 705 M content1_content1_content3-tracked
705 706 M content1_content2_content1-tracked
706 707 M content1_content2_content3-tracked
707 708 M missing_content2_content3-tracked
708 709 A content1_missing_content1-tracked
709 710 A content1_missing_content3-tracked
710 711 A missing_missing_content3-tracked
711 712 R content1_content1_content1-untracked
712 713 R content1_content1_content3-untracked
713 714 R content1_content1_missing-untracked
714 715 R content1_content2_content1-untracked
715 716 R content1_content2_content2-untracked
716 717 R content1_content2_content3-untracked
717 718 R content1_content2_missing-untracked
718 719 R missing_content2_content2-untracked
719 720 R missing_content2_content3-untracked
720 721 R missing_content2_missing-untracked
721 722 ! content1_content1_missing-tracked
722 723 ! content1_content2_missing-tracked
723 724 ! content1_missing_missing-tracked
724 725 ! missing_content2_missing-tracked
725 726 ! missing_missing_missing-tracked
726 727 ? content1_missing_content1-untracked
727 728 ? content1_missing_content3-untracked
728 729 ? missing_missing_content3-untracked
729 730
730 731 $ hg status --rev 'desc("base")'
731 732 M content1_content1_content3-tracked
732 733 M content1_content2_content2-tracked
733 734 M content1_content2_content3-tracked
734 735 M content1_missing_content3-tracked
735 736 A missing_content2_content2-tracked
736 737 A missing_content2_content3-tracked
737 738 A missing_missing_content3-tracked
738 739 R content1_content1_content1-untracked
739 740 R content1_content1_content3-untracked
740 741 R content1_content1_missing-untracked
741 742 R content1_content2_content1-untracked
742 743 R content1_content2_content2-untracked
743 744 R content1_content2_content3-untracked
744 745 R content1_content2_missing-untracked
745 746 R content1_missing_content1-untracked
746 747 R content1_missing_content3-untracked
747 748 R content1_missing_missing-untracked
748 749 ! content1_content1_missing-tracked
749 750 ! content1_content2_missing-tracked
750 751 ! content1_missing_missing-tracked
751 752 ! missing_content2_missing-tracked
752 753 ! missing_missing_missing-tracked
753 754 ? missing_missing_content3-untracked
754 755
755 756 (create a simple text version of the content)
756 757
757 758 $ "$PYTHON" ../dircontent.py > ../content-wc.txt
758 759 $ cat ../content-wc.txt
759 760 content1 content1_content1_content1-tracked
760 761 content1 content1_content1_content1-untracked
761 762 content3 content1_content1_content3-tracked
762 763 content3 content1_content1_content3-untracked
763 764 content1 content1_content2_content1-tracked
764 765 content1 content1_content2_content1-untracked
765 766 content2 content1_content2_content2-tracked
766 767 content2 content1_content2_content2-untracked
767 768 content3 content1_content2_content3-tracked
768 769 content3 content1_content2_content3-untracked
769 770 content1 content1_missing_content1-tracked
770 771 content1 content1_missing_content1-untracked
771 772 content3 content1_missing_content3-tracked
772 773 content3 content1_missing_content3-untracked
773 774 content2 missing_content2_content2-tracked
774 775 content2 missing_content2_content2-untracked
775 776 content3 missing_content2_content3-tracked
776 777 content3 missing_content2_content3-untracked
777 778 content3 missing_missing_content3-tracked
778 779 content3 missing_missing_content3-untracked
779 780
780 781 $ cd ..
781 782
782 783 Test revert --all to parent content
783 784 -----------------------------------
784 785
785 786 (setup from reference repo)
786 787
787 788 $ cp -R revert-ref revert-parent-all
788 789 $ cd revert-parent-all
789 790
790 791 check revert output
791 792
792 793 $ hg revert --all
793 794 forgetting content1_missing_content1-tracked
794 795 forgetting content1_missing_content3-tracked
795 796 forgetting content1_missing_missing-tracked
796 797 forgetting missing_missing_content3-tracked
797 798 forgetting missing_missing_missing-tracked
798 799 reverting content1_content1_content3-tracked
799 800 reverting content1_content1_missing-tracked
800 801 reverting content1_content2_content1-tracked
801 802 reverting content1_content2_content3-tracked
802 803 reverting content1_content2_missing-tracked
803 804 reverting missing_content2_content3-tracked
804 805 reverting missing_content2_missing-tracked
805 806 undeleting content1_content1_content1-untracked
806 807 undeleting content1_content1_content3-untracked
807 808 undeleting content1_content1_missing-untracked
808 809 undeleting content1_content2_content1-untracked
809 810 undeleting content1_content2_content2-untracked
810 811 undeleting content1_content2_content3-untracked
811 812 undeleting content1_content2_missing-untracked
812 813 undeleting missing_content2_content2-untracked
813 814 undeleting missing_content2_content3-untracked
814 815 undeleting missing_content2_missing-untracked
815 816
816 817 Compare resulting directory with revert target.
817 818
818 819 The diff is filtered to include change only. The only difference should be
819 820 additional `.orig` backup file when applicable.
820 821
821 822 $ "$PYTHON" ../dircontent.py > ../content-parent-all.txt
822 823 $ cd ..
823 824 $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _
824 825 +content3 content1_content1_content3-tracked.orig
825 826 +content3 content1_content1_content3-untracked.orig
826 827 +content1 content1_content2_content1-tracked.orig
827 828 +content1 content1_content2_content1-untracked.orig
828 829 +content3 content1_content2_content3-tracked.orig
829 830 +content3 content1_content2_content3-untracked.orig
830 831 +content1 content1_missing_content1-tracked
831 832 +content1 content1_missing_content1-untracked
832 833 +content3 content1_missing_content3-tracked
833 834 +content3 content1_missing_content3-untracked
834 835 +content3 missing_content2_content3-tracked.orig
835 836 +content3 missing_content2_content3-untracked.orig
836 837 +content3 missing_missing_content3-tracked
837 838 +content3 missing_missing_content3-untracked
838 839
839 840 Test revert --all to "base" content
840 841 -----------------------------------
841 842
842 843 (setup from reference repo)
843 844
844 845 $ cp -R revert-ref revert-base-all
845 846 $ cd revert-base-all
846 847
847 848 check revert output
848 849
849 850 $ hg revert --all --rev 'desc(base)'
850 851 forgetting missing_missing_content3-tracked
851 852 forgetting missing_missing_missing-tracked
852 853 removing missing_content2_content2-tracked
853 854 removing missing_content2_content3-tracked
854 855 removing missing_content2_missing-tracked
855 856 reverting content1_content1_content3-tracked
856 857 reverting content1_content1_missing-tracked
857 858 reverting content1_content2_content2-tracked
858 859 reverting content1_content2_content3-tracked
859 860 reverting content1_content2_missing-tracked
860 861 reverting content1_missing_content3-tracked
861 862 reverting content1_missing_missing-tracked
862 863 adding content1_missing_content1-untracked
863 864 adding content1_missing_content3-untracked
864 865 adding content1_missing_missing-untracked
865 866 undeleting content1_content1_content1-untracked
866 867 undeleting content1_content1_content3-untracked
867 868 undeleting content1_content1_missing-untracked
868 869 undeleting content1_content2_content1-untracked
869 870 undeleting content1_content2_content2-untracked
870 871 undeleting content1_content2_content3-untracked
871 872 undeleting content1_content2_missing-untracked
872 873
873 874 Compare resulting directory with revert target.
874 875
875 876 The diff is filtered to include change only. The only difference should be
876 877 additional `.orig` backup file when applicable.
877 878
878 879 $ "$PYTHON" ../dircontent.py > ../content-base-all.txt
879 880 $ cd ..
880 881 $ diff -U 0 -- content-base.txt content-base-all.txt | grep _
881 882 +content3 content1_content1_content3-tracked.orig
882 883 +content3 content1_content1_content3-untracked.orig
883 884 +content2 content1_content2_content2-untracked.orig
884 885 +content3 content1_content2_content3-tracked.orig
885 886 +content3 content1_content2_content3-untracked.orig
886 887 +content3 content1_missing_content3-tracked.orig
887 888 +content3 content1_missing_content3-untracked.orig
888 889 +content2 missing_content2_content2-untracked
889 890 +content3 missing_content2_content3-tracked.orig
890 891 +content3 missing_content2_content3-untracked
891 892 +content3 missing_missing_content3-tracked
892 893 +content3 missing_missing_content3-untracked
893 894
894 895 Test revert to parent content with explicit file name
895 896 -----------------------------------------------------
896 897
897 898 (setup from reference repo)
898 899
899 900 $ cp -R revert-ref revert-parent-explicit
900 901 $ cd revert-parent-explicit
901 902
902 903 revert all files individually and check the output
903 904 (output is expected to be different than in the --all case)
904 905
905 906 $ for file in `"$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 2`; do
906 907 > echo '### revert for:' $file;
907 908 > hg revert $file;
908 909 > echo
909 910 > done
910 911 ### revert for: content1_content1_content1-tracked
911 912 no changes needed to content1_content1_content1-tracked
912 913
913 914 ### revert for: content1_content1_content1-untracked
914 915
915 916 ### revert for: content1_content1_content3-tracked
916 917
917 918 ### revert for: content1_content1_content3-untracked
918 919
919 920 ### revert for: content1_content1_missing-tracked
920 921
921 922 ### revert for: content1_content1_missing-untracked
922 923
923 924 ### revert for: content1_content2_content1-tracked
924 925
925 926 ### revert for: content1_content2_content1-untracked
926 927
927 928 ### revert for: content1_content2_content2-tracked
928 929 no changes needed to content1_content2_content2-tracked
929 930
930 931 ### revert for: content1_content2_content2-untracked
931 932
932 933 ### revert for: content1_content2_content3-tracked
933 934
934 935 ### revert for: content1_content2_content3-untracked
935 936
936 937 ### revert for: content1_content2_missing-tracked
937 938
938 939 ### revert for: content1_content2_missing-untracked
939 940
940 941 ### revert for: content1_missing_content1-tracked
941 942
942 943 ### revert for: content1_missing_content1-untracked
943 944 file not managed: content1_missing_content1-untracked
944 945
945 946 ### revert for: content1_missing_content3-tracked
946 947
947 948 ### revert for: content1_missing_content3-untracked
948 949 file not managed: content1_missing_content3-untracked
949 950
950 951 ### revert for: content1_missing_missing-tracked
951 952
952 953 ### revert for: content1_missing_missing-untracked
953 954 content1_missing_missing-untracked: no such file in rev * (glob)
954 955
955 956 ### revert for: missing_content2_content2-tracked
956 957 no changes needed to missing_content2_content2-tracked
957 958
958 959 ### revert for: missing_content2_content2-untracked
959 960
960 961 ### revert for: missing_content2_content3-tracked
961 962
962 963 ### revert for: missing_content2_content3-untracked
963 964
964 965 ### revert for: missing_content2_missing-tracked
965 966
966 967 ### revert for: missing_content2_missing-untracked
967 968
968 969 ### revert for: missing_missing_content3-tracked
969 970
970 971 ### revert for: missing_missing_content3-untracked
971 972 file not managed: missing_missing_content3-untracked
972 973
973 974 ### revert for: missing_missing_missing-tracked
974 975
975 976 ### revert for: missing_missing_missing-untracked
976 977 missing_missing_missing-untracked: no such file in rev * (glob)
977 978
978 979
979 980 check resulting directory against the --all run
980 981 (There should be no difference)
981 982
982 983 $ "$PYTHON" ../dircontent.py > ../content-parent-explicit.txt
983 984 $ cd ..
984 985 $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _
985 986 [1]
986 987
987 988 Test revert to "base" content with explicit file name
988 989 -----------------------------------------------------
989 990
990 991 (setup from reference repo)
991 992
992 993 $ cp -R revert-ref revert-base-explicit
993 994 $ cd revert-base-explicit
994 995
995 996 revert all files individually and check the output
996 997 (output is expected to be different than in the --all case)
997 998
998 999 $ for file in `"$PYTHON" $TESTDIR/generate-working-copy-states.py filelist 2`; do
999 1000 > echo '### revert for:' $file;
1000 1001 > hg revert $file --rev 'desc(base)';
1001 1002 > echo
1002 1003 > done
1003 1004 ### revert for: content1_content1_content1-tracked
1004 1005 no changes needed to content1_content1_content1-tracked
1005 1006
1006 1007 ### revert for: content1_content1_content1-untracked
1007 1008
1008 1009 ### revert for: content1_content1_content3-tracked
1009 1010
1010 1011 ### revert for: content1_content1_content3-untracked
1011 1012
1012 1013 ### revert for: content1_content1_missing-tracked
1013 1014
1014 1015 ### revert for: content1_content1_missing-untracked
1015 1016
1016 1017 ### revert for: content1_content2_content1-tracked
1017 1018 no changes needed to content1_content2_content1-tracked
1018 1019
1019 1020 ### revert for: content1_content2_content1-untracked
1020 1021
1021 1022 ### revert for: content1_content2_content2-tracked
1022 1023
1023 1024 ### revert for: content1_content2_content2-untracked
1024 1025
1025 1026 ### revert for: content1_content2_content3-tracked
1026 1027
1027 1028 ### revert for: content1_content2_content3-untracked
1028 1029
1029 1030 ### revert for: content1_content2_missing-tracked
1030 1031
1031 1032 ### revert for: content1_content2_missing-untracked
1032 1033
1033 1034 ### revert for: content1_missing_content1-tracked
1034 1035 no changes needed to content1_missing_content1-tracked
1035 1036
1036 1037 ### revert for: content1_missing_content1-untracked
1037 1038
1038 1039 ### revert for: content1_missing_content3-tracked
1039 1040
1040 1041 ### revert for: content1_missing_content3-untracked
1041 1042
1042 1043 ### revert for: content1_missing_missing-tracked
1043 1044
1044 1045 ### revert for: content1_missing_missing-untracked
1045 1046
1046 1047 ### revert for: missing_content2_content2-tracked
1047 1048
1048 1049 ### revert for: missing_content2_content2-untracked
1049 1050 no changes needed to missing_content2_content2-untracked
1050 1051
1051 1052 ### revert for: missing_content2_content3-tracked
1052 1053
1053 1054 ### revert for: missing_content2_content3-untracked
1054 1055 no changes needed to missing_content2_content3-untracked
1055 1056
1056 1057 ### revert for: missing_content2_missing-tracked
1057 1058
1058 1059 ### revert for: missing_content2_missing-untracked
1059 1060 no changes needed to missing_content2_missing-untracked
1060 1061
1061 1062 ### revert for: missing_missing_content3-tracked
1062 1063
1063 1064 ### revert for: missing_missing_content3-untracked
1064 1065 file not managed: missing_missing_content3-untracked
1065 1066
1066 1067 ### revert for: missing_missing_missing-tracked
1067 1068
1068 1069 ### revert for: missing_missing_missing-untracked
1069 1070 missing_missing_missing-untracked: no such file in rev * (glob)
1070 1071
1071 1072
1072 1073 check resulting directory against the --all run
1073 1074 (There should be no difference)
1074 1075
1075 1076 $ "$PYTHON" ../dircontent.py > ../content-base-explicit.txt
1076 1077 $ cd ..
1077 1078 $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _
1078 1079 [1]
1079 1080
1080 1081 Revert to an ancestor of P2 during a merge (issue5052)
1081 1082 -----------------------------------------------------
1082 1083
1083 1084 (prepare the repository)
1084 1085
1085 1086 $ hg init issue5052
1086 1087 $ cd issue5052
1087 1088 $ echo '.\.orig' > .hgignore
1088 1089 $ echo 0 > root
1089 1090 $ hg ci -qAm C0
1090 1091 $ echo 0 > A
1091 1092 $ hg ci -qAm C1
1092 1093 $ echo 1 >> A
1093 1094 $ hg ci -qm C2
1094 1095 $ hg up -q 0
1095 1096 $ echo 1 > B
1096 1097 $ hg ci -qAm C3
1097 1098 $ hg status --rev 'ancestor(.,2)' --rev 2
1098 1099 A A
1099 1100 $ hg log -G -T '{rev} ({files})\n'
1100 1101 @ 3 (B)
1101 1102 |
1102 1103 | o 2 (A)
1103 1104 | |
1104 1105 | o 1 (A)
1105 1106 |/
1106 1107 o 0 (.hgignore root)
1107 1108
1108 1109
1109 1110 actual tests: reverting to something else than a merge parent
1110 1111
1111 1112 $ hg merge
1112 1113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1113 1114 (branch merge, don't forget to commit)
1114 1115
1115 1116 $ hg status --rev 'p1()'
1116 1117 M A
1117 1118 $ hg status --rev 'p2()'
1118 1119 A B
1119 1120 $ hg status --rev '1'
1120 1121 M A
1121 1122 A B
1122 1123 $ hg revert --rev 1 --all
1123 1124 removing B
1124 1125 reverting A
1125 1126 $ hg status --rev 1
1126 1127
1127 1128 From the other parents
1128 1129
1129 1130 $ hg up -C 'p2()'
1130 1131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1131 1132 $ hg merge
1132 1133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1133 1134 (branch merge, don't forget to commit)
1134 1135
1135 1136 $ hg status --rev 'p1()'
1136 1137 M B
1137 1138 $ hg status --rev 'p2()'
1138 1139 A A
1139 1140 $ hg status --rev '1'
1140 1141 M A
1141 1142 A B
1142 1143 $ hg revert --rev 1 --all
1143 1144 removing B
1144 1145 reverting A
1145 1146 $ hg status --rev 1
1146 1147
1147 1148 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now