diff tests/test-uncommit.t @ 3418:85cdce113c2c mercurial-4.3

test-compat: merge stable into mercurial-4.3
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 16 Jan 2018 04:35:34 +0100
parents e1a230cc4527 e1f3e43a50a4
children 98941c28f3e2
line wrap: on
line diff
--- a/tests/test-uncommit.t	Sat Dec 16 23:40:39 2017 +0100
+++ b/tests/test-uncommit.t	Tue Jan 16 04:35:34 2018 +0100
@@ -459,3 +459,54 @@
   R g
   R m
   R n
+
+Testing the --revert flag of `hg uncommit`
+
+When working directory before uncommit is clean
+
+  $ hg amend
+  $ hg status
+  ? b
+
+  $ hg diff -c . --stat
+   aa |  1 +
+   b  |  1 -
+   c  |  1 -
+   d  |  1 +
+   e  |  1 +
+   f  |  1 -
+   ff |  1 +
+   g  |  1 -
+   h  |  1 +
+   j  |  1 +
+   k  |  1 +
+   l  |  1 +
+   m  |  1 -
+   n  |  1 -
+   o  |  1 +
+   15 files changed, 9 insertions(+), 6 deletions(-)
+  $ hg uncommit --revert --all
+  new changeset is empty
+  (use 'hg prune .' to remove it)
+  $ hg status
+
+When working directory is dirty before uncommit
+
+  $ echo foo > a
+  $ echo foo > b
+  $ echo foo > c
+  $ hg status
+  M a
+  M b
+  M c
+  $ hg amend
+  $ echo foo > foo
+  $ hg add foo
+  $ hg status
+  A foo
+
+  $ hg uncommit --revert --all
+  new changeset is empty
+  (use 'hg prune .' to remove it)
+  $ hg status
+  ? foo