changeset 1634:f49f602fae92

copy & rename can ignore removed source files As mercurial now distinguishes deleted files from removed files, we can skip removed source files while copying or renaming.
author Robin Farine <robin.farine@terminus.org>
date Tue, 24 Jan 2006 13:59:01 +1300
parents 94c179a92f4a
children ae61937c61c5
files mercurial/commands.py tests/test-rename tests/test-rename.out
diffstat 3 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Jan 24 13:57:09 2006 +1300
+++ b/mercurial/commands.py	Tue Jan 24 13:59:01 2006 +1300
@@ -804,7 +804,8 @@
 
     def okaytocopy(abs, rel, exact):
         reasons = {'?': _('is not managed'),
-                   'a': _('has been marked for add')}
+                   'a': _('has been marked for add'),
+                   'r': _('has been marked for remove')}
         reason = reasons.get(repo.dirstate.state(abs))
         if reason:
             if exact:
--- a/tests/test-rename	Tue Jan 24 13:57:09 2006 +1300
+++ b/tests/test-rename	Tue Jan 24 13:59:01 2006 +1300
@@ -152,3 +152,9 @@
 (cd d1/d11; hg rename .. ../../d3)
 hg status
 hg update -C
+
+echo "# skip removed files"
+hg remove d1/b
+hg rename d1 d3
+hg status
+hg update -C
--- a/tests/test-rename.out	Tue Jan 24 13:57:09 2006 +1300
+++ b/tests/test-rename.out	Tue Jan 24 13:59:01 2006 +1300
@@ -232,3 +232,17 @@
 R d1/b
 R d1/ba
 R d1/d11/a1
+# skip removed files
+copying d1/a to d3/a
+copying d1/ba to d3/ba
+copying d1/d11/a1 to d3/d11/a1
+removing d1/a
+removing d1/ba
+removing d1/d11/a1
+A d3/a
+A d3/ba
+A d3/d11/a1
+R d1/a
+R d1/b
+R d1/ba
+R d1/d11/a1