mercurial/commands.py
branchstable
changeset 12129 07ac2a560fce
parent 12128 090dc5eef746
child 12130 48735ce02345
child 12382 28ddf67198b2
--- a/mercurial/commands.py	Wed Sep 01 12:05:57 2010 +0200
+++ b/mercurial/commands.py	Mon Aug 30 20:27:25 2010 -0400
@@ -2916,21 +2916,24 @@
             ui.warn(_('not removing %s: file is untracked\n') % m.rel(f))
             ret = 1
 
-    def warn(files, reason):
-        for f in files:
-            ui.warn(_('not removing %s: file %s (use -f to force removal)\n')
-                    % (m.rel(f), reason))
-            ret = 1
-
     if force:
         remove, forget = modified + deleted + clean, added
     elif after:
         remove, forget = deleted, []
-        warn(modified + added + clean, _('still exists'))
+        for f in modified + added + clean:
+            ui.warn(_('not removing %s: file still exists (use -f'
+                      ' to force removal)\n') % m.rel(f))
+            ret = 1
     else:
         remove, forget = deleted + clean, []
-        warn(modified, _('is modified'))
-        warn(added, _('has been marked for add'))
+        for f in modified:
+            ui.warn(_('not removing %s: file is modified (use -f'
+                      ' to force removal)\n') % m.rel(f))
+            ret = 1
+        for f in added:
+            ui.warn(_('not removing %s: file has been marked for add (use -f'
+                      ' to force removal)\n') % m.rel(f))
+            ret = 1
 
     for f in sorted(remove + forget):
         if ui.verbose or not m.exact(f):