Make remove command really unlink files.
authorBryan O'Sullivan <bos@serpentine.com>
Wed, 14 Sep 2005 10:50:03 -0700
changeset 1247 7a70dafbf4b9
parent 1241 3b4f05ff3130
child 1248 2534b41ce0c5
Make remove command really unlink files.
doc/hg.1.txt
mercurial/commands.py
--- a/doc/hg.1.txt	Wed Sep 14 12:22:20 2005 -0500
+++ b/doc/hg.1.txt	Wed Sep 14 10:50:03 2005 -0700
@@ -432,7 +432,8 @@
 
     This command schedules the files to be removed at the next commit.
     This only removes files from the current branch, not from the
-    entire project history.
+    entire project history.  If the files still exist in the working
+    directory, they will be deleted from it.
 
     aliases: rm
 
--- a/mercurial/commands.py	Wed Sep 14 12:22:20 2005 -0500
+++ b/mercurial/commands.py	Wed Sep 14 10:50:03 2005 -0700
@@ -1313,6 +1313,11 @@
         if okaytoremove(abs, rel, exact):
             if 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)
 
 def revert(ui, repo, *names, **opts):