changeset 2043:968f036f93a4

Minor fix for revert: No need to make a backup when forgetting added files. echo foo > foo && hg add foo && hg revert foo creates foo.orig, though foo is not changed or deleted.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 03 Apr 2006 21:01:33 +0200
parents a514c7509fa9
children b343e7d454b4
files mercurial/commands.py tests/test-confused-revert.out tests/test-revert tests/test-revert.out
diffstat 4 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Apr 03 10:02:09 2006 -0700
+++ b/mercurial/commands.py	Mon Apr 03 21:01:33 2006 +0200
@@ -2389,7 +2389,7 @@
         #   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),
--- a/tests/test-confused-revert.out	Mon Apr 03 10:02:09 2006 -0700
+++ b/tests/test-confused-revert.out	Mon Apr 03 21:01:33 2006 +0200
@@ -6,19 +6,16 @@
 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
--- a/tests/test-revert	Mon Apr 03 10:02:09 2006 -0700
+++ b/tests/test-revert	Mon Apr 03 21:01:33 2006 +0200
@@ -22,12 +22,12 @@
 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
--- a/tests/test-revert.out	Mon Apr 03 10:02:09 2006 -0700
+++ b/tests/test-revert.out	Mon Apr 03 21:01:33 2006 +0200
@@ -13,17 +13,14 @@
 %% 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 @@
 notfound: No such file in rev 095eacd0c0d7
 A z
 ? b
-? b.orig
 ? e.orig
 %% should add a, forget z
 adding a