diff mercurial/context.py @ 14518:a67e866f46f9

workingctx: eliminate remove function Inlining it into it's last remaining call place in cmdutil.copy. Note that cmdutil.copy is called with the wlock already held, so no additional locking is needed to call util.unlinkpath. We do not need to wrap the util.unlinkpath call into a try block, because at that point we already know whether abssrc exists or not -- thanks to the preceding util.copyfile call. Adding a new local 'srcexists' in cmdutil.copy for that purpose.
author Adrian Buehlmann <adrian@cadifra.com>
date Thu, 02 Jun 2011 00:33:33 +0200
parents f3b50431eb7e
children 0bd69e37fd20
line wrap: on
line diff
--- a/mercurial/context.py	Thu Jun 02 19:43:17 2011 +0200
+++ b/mercurial/context.py	Thu Jun 02 00:33:33 2011 +0200
@@ -853,20 +853,6 @@
             *[p.rev() for p in self._parents]):
             yield changectx(self._repo, a)
 
-    def remove(self, list, unlink=False):
-        wlock = self._repo.wlock()
-        try:
-            if unlink:
-                for f in list:
-                    try:
-                        util.unlinkpath(self._repo.wjoin(f))
-                    except OSError, inst:
-                        if inst.errno != errno.ENOENT:
-                            raise
-            self.forget(list)
-        finally:
-            wlock.release()
-
     def undelete(self, list):
         pctxs = self.parents()
         wlock = self._repo.wlock()