Mercurial > evolve
comparison tests/test-uncommit.t @ 3389:eacf6149b678
uncommit: add a new flag `--revert` to discard wdir changes after uncommit
This patch adds a new flag to `hg uncommit` using which one can discard the wdir
changes which are left after the operation. Both the changes, the ones which
were before the uncommit and the ones which were added to wdir as a result of
uncommit as cleared out.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 09 Jan 2018 20:01:50 +0530 |
parents | 1905aac253f0 |
children | 39112fd4d5ed |
comparison
equal
deleted
inserted
replaced
3388:be41e4740a25 | 3389:eacf6149b678 |
---|---|
459 R c | 459 R c |
460 R f | 460 R f |
461 R g | 461 R g |
462 R m | 462 R m |
463 R n | 463 R n |
464 | |
465 Testing the --revert flag of `hg uncommit` | |
466 | |
467 When working directory before uncommit is clean | |
468 | |
469 $ hg amend | |
470 $ hg status | |
471 ? b | |
472 | |
473 $ hg diff -c . --stat | |
474 aa | 1 + | |
475 b | 1 - | |
476 c | 1 - | |
477 d | 1 + | |
478 e | 1 + | |
479 f | 1 - | |
480 ff | 1 + | |
481 g | 1 - | |
482 h | 1 + | |
483 j | 1 + | |
484 k | 1 + | |
485 l | 1 + | |
486 m | 1 - | |
487 n | 1 - | |
488 o | 1 + | |
489 15 files changed, 9 insertions(+), 6 deletions(-) | |
490 $ hg uncommit --revert --all | |
491 new changeset is empty | |
492 (use 'hg prune .' to remove it) | |
493 $ hg status | |
494 | |
495 When working directory is dirty before uncommit | |
496 | |
497 $ echo foo > a | |
498 $ echo foo > b | |
499 $ echo foo > c | |
500 $ hg status | |
501 M a | |
502 M b | |
503 M c | |
504 $ hg amend | |
505 $ echo foo > foo | |
506 $ hg add foo | |
507 $ hg status | |
508 A foo | |
509 | |
510 $ hg uncommit --revert --all | |
511 new changeset is empty | |
512 (use 'hg prune .' to remove it) | |
513 $ hg status | |
514 ? foo |