changeset 14604:b1a534335548

forget, remove: don't note on nonexistent file twice before: $ hg forget foo foo: No such file or directory not removing foo: file is already untracked after: $ hg forget foo foo: No such file or directory
author Idan Kamara <idankk86@gmail.com>
date Mon, 13 Jun 2011 14:56:00 +0300
parents 68a43fdd7d80
children 9f1139cf5c76
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Jun 13 12:51:38 2011 -0500
+++ b/mercurial/commands.py	Mon Jun 13 14:56:00 2011 +0300
@@ -2272,8 +2272,9 @@
 
     for f in m.files():
         if f not in repo.dirstate and not os.path.isdir(m.rel(f)):
-            ui.warn(_('not removing %s: file is already untracked\n')
-                    % m.rel(f))
+            if os.path.exists(m.rel(f)):
+                ui.warn(_('not removing %s: file is already untracked\n')
+                        % m.rel(f))
             errs = 1
 
     for f in forget:
@@ -3917,7 +3918,8 @@
 
     for f in m.files():
         if f not in repo.dirstate and not os.path.isdir(m.rel(f)):
-            ui.warn(_('not removing %s: file is untracked\n') % m.rel(f))
+            if os.path.exists(m.rel(f)):
+                ui.warn(_('not removing %s: file is untracked\n') % m.rel(f))
             ret = 1
 
     if force: