mercurial/commands.py
changeset 1415 c6e6ca96a033
parent 1413 1c64c628d15f
child 1420 b32b3509c7ab
--- a/mercurial/commands.py	Wed Oct 19 00:05:08 2005 -0700
+++ b/mercurial/commands.py	Wed Oct 19 00:10:52 2005 -0700
@@ -1441,12 +1441,7 @@
         if okaytoremove(abs, rel, exact):
             if ui.verbose or not exact: ui.status(_('removing %s\n') % rel)
             names.append(abs)
-    for name in names:
-        try:
-            os.unlink(name)
-        except OSError, inst:
-            if inst.errno != errno.ENOENT: raise
-    repo.remove(names)
+    repo.remove(names, unlink=True)
 
 def rename(ui, repo, *pats, **opts):
     """rename files; equivalent of copy + remove"""
@@ -1454,12 +1449,8 @@
     names = []
     for abs, rel, exact in copied:
         if ui.verbose or not exact: ui.status(_('removing %s\n') % rel)
-        try:
-            os.unlink(rel)
-        except OSError, inst:
-            if inst.errno != errno.ENOENT: raise
         names.append(abs)
-    repo.remove(names)
+    repo.remove(names, unlink=True)
     return errs
 
 def revert(ui, repo, *names, **opts):