diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2389,7 +2389,7 @@ def revert(ui, repo, *pats, **opts): # make backup if in target manifest # make backup if not in target manifest (modified, revert, remove, True, True), - (added, revert, forget, True, True), + (added, revert, forget, True, False), (removed, undelete, None, False, False), (deleted, revert, remove, False, False), (unknown, add, None, True, False), diff --git a/tests/test-confused-revert.out b/tests/test-confused-revert.out --- a/tests/test-confused-revert.out +++ b/tests/test-confused-revert.out @@ -6,19 +6,16 @@ undeleting a forgetting b %%% should show b unknown and a back to normal ? b -? b.orig merging a %%% should show foo-b foo-b %%% should show a removed and b added A b R a -? b.orig reverting... undeleting a forgetting b %%% should show b unknown and a marked modified (merged) ? b -? b.orig %%% should show foo-b foo-b diff --git a/tests/test-revert b/tests/test-revert --- a/tests/test-revert +++ b/tests/test-revert @@ -22,12 +22,12 @@ hg revert a echo %% should show b added, copy saved, and c modified hg status hg revert b -echo %% should show b unknown, b.orig unknown, and c modified +echo %% should show b unknown, and c modified hg status hg revert --no-backup c -echo %% should show unknown: b b.orig +echo %% should show unknown: b hg status -echo %% should show a b b.orig c e +echo %% should show a b c e ls echo %% should verbosely save backup to e.orig echo z > e diff --git a/tests/test-revert.out b/tests/test-revert.out --- a/tests/test-revert.out +++ b/tests/test-revert.out @@ -13,17 +13,14 @@ R a %% should show b added, copy saved, and c modified M c A b -%% should show b unknown, b.orig unknown, and c modified +%% should show b unknown, and c modified M c ? b -? b.orig -%% should show unknown: b b.orig +%% should show unknown: b ? b -? b.orig -%% should show a b b.orig c e +%% should show a b c e a b -b.orig c e %% should verbosely save backup to e.orig @@ -40,7 +37,6 @@ file not managed: q notfound: No such file in rev 095eacd0c0d7 A z ? b -? b.orig ? e.orig %% should add a, forget z adding a