Commit Graph

10 Commits

Author SHA1 Message Date
Adrian Buehlmann
13cd3f341f test-revert: add revert --all case when nothing changed
supposed to succeed without notice
2011-06-28 00:56:33 +02:00
Adrian Buehlmann
9b3812c8c6 revert: improve hints on abort when reverting to parent without --all
BEFORE:

    $ hg revert
    abort: no files or directories specified
    (use --all to discard all changes)

AFTER:

  Uncommitted changes (using --all *will* nuke edits):

    $ hg revert
    abort: no files or directories specified
    (uncommitted changes, use --all to discard all changes)

  Clean working directory (using --all won't discard anything):

    $ hg revert
    abort: no files or directories specified
    (use --all to revert all files)
2011-06-26 01:13:30 +02:00
Adrian Buehlmann
bb2cb4edc9 test-revert: add case for nothing changed 2011-06-24 23:29:51 +02:00
Adrian Buehlmann
1d541dffa3 revert: mention update in hint of abort when reverting to non-parent
and explicitly warn about uncommitted changes

Examples:

BEFORE:

    $ hg par -q
    7:e81a2efd53d4
    $ hg revert -r 2
    abort: no files or directories specified
    (use --all to discard all changes)

AFTER:

  Clean working directory (revert can be easily undone, no edits to be lost):

    $ hg revert -r 2
    abort: no files or directories specified
    (use --all to revert all files, or 'hg update 2' to update)

  Uncommitted changes (revert --all *does* discard edits and is pretty hard to
  undo or even impossible if --no-backup is specified):

    $ hg revert -r 2
    abort: no files or directories specified
    (uncommitted changes, use --all to discard all changes, or 'hg update 2' to update)
2011-06-24 12:37:29 +02:00
Kevin Bullock
99e4d74da2 revert: be more explicit that changes are lost
BEFORE:
   $ hg revert
   abort: no files or directories specified
   (use --all to revert all files)

 AFTER:
   $ hg revert
   abort: no files or directories specified
   (use --all to discard all changes)
2011-06-20 22:15:52 -05:00
Matt Mackall
40ee99d81f revert: drop requirement to use -r to revert with two parents
This reduces documentation confusion between the need to:

a) hg revert -a -r .  (drop all changes from a merge)
b) hg up -C .         (drop the second parent entirely)

Currently revert is one of two commands (the other being tag) that
still complains about uncommitted merges, dating from its former use
of a generic defaultrev function that aborted.
2011-06-07 14:19:05 -05:00
Martin Geisler
3d112b3042 tests: added a short description to issue numbers
Many tests already had a short line to describe what IssueXXX is
about. I find that quite useful when reading a test.
2010-09-24 10:13:49 +02:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Martin Geisler
cc612c476f tests: remove unneeded -d flags
Many tests fixed the commit date of their changesets at '1000000 0' or
similar. However testing with "Mon Jan 12 13:46:40 1970 +0000" is not
better than testing with "Thu Jan 01 00:00:00 1970 +0000", which is
the default run-tests.py installs.

Removing the unnecessary flag removes some clutter and will hopefully
make it clearer what the tests are really trying to test. Some tests
did not even change their output when the dates were changed, in which
case the -d flag was truly irrelevant.

Dates used in sequence (such as '0 0', '1 0', etc...) were left alone
since they may make the test easier to understand.
2010-09-02 23:22:51 +02:00
Nicolas Dumazet
a0476898ab tests: unify test-revert 2010-08-30 13:32:37 +09:00