diff -r 03f6480bfdda -r f4147ca63d39 tests/test-uncommit.t --- a/tests/test-uncommit.t Mon Mar 25 12:33:41 2019 +0530 +++ b/tests/test-uncommit.t Fri Mar 29 21:53:15 2019 -0400 @@ -102,14 +102,16 @@ $ hg heads -T '{rev}:{node} {desc}' 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde (no-eol) -Uncommit of non-existent and unchanged files has no effect +Uncommit of non-existent and unchanged files aborts $ hg uncommit nothinghere - nothing to uncommit - [1] + abort: cannot uncommit "nothinghere" + (file does not exist) + [255] $ hg status $ hg uncommit file-abc - nothing to uncommit - [1] + abort: cannot uncommit "file-abc" + (file was not changed in working directory parent) + [255] $ hg status Try partial uncommit, also moves bookmark @@ -513,3 +515,57 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: add a +Removes can be uncommitted + + $ hg ci -m 'modified b' + $ hg rm b + $ hg ci -m 'remove b' + $ hg uncommit b + note: keeping empty commit + $ hg status + R b + +Uncommitting a directory won't run afoul of the checks that an explicit file +can be uncommitted. + + $ mkdir dir + $ echo 1 > dir/file.txt + $ hg ci -Aqm 'add file in directory' + $ hg uncommit dir + $ hg status + A dir/file.txt + +`uncommit