##// END OF EJS Templates
workingctx: eliminate remove function...
Adrian Buehlmann -
r14518:a67e866f default
parent child Browse files
Show More
@@ -281,9 +281,11 b' def copy(ui, repo, pats, opts, rename=Fa'
281 281 if not os.path.isdir(targetdir):
282 282 os.makedirs(targetdir)
283 283 util.copyfile(src, target)
284 srcexists = True
284 285 except IOError, inst:
285 286 if inst.errno == errno.ENOENT:
286 287 ui.warn(_('%s: deleted in working copy\n') % relsrc)
288 srcexists = False
287 289 else:
288 290 ui.warn(_('%s: cannot copy - %s\n') %
289 291 (relsrc, inst.strerror))
@@ -301,7 +303,9 b' def copy(ui, repo, pats, opts, rename=Fa'
301 303 scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
302 304 dryrun=dryrun, cwd=cwd)
303 305 if rename and not dryrun:
304 wctx.remove([abssrc], not after)
306 if not after and srcexists:
307 util.unlinkpath(repo.wjoin(abssrc))
308 wctx.forget([abssrc])
305 309
306 310 # pat: ossep
307 311 # dest ossep
@@ -853,20 +853,6 b' class workingctx(changectx):'
853 853 *[p.rev() for p in self._parents]):
854 854 yield changectx(self._repo, a)
855 855
856 def remove(self, list, unlink=False):
857 wlock = self._repo.wlock()
858 try:
859 if unlink:
860 for f in list:
861 try:
862 util.unlinkpath(self._repo.wjoin(f))
863 except OSError, inst:
864 if inst.errno != errno.ENOENT:
865 raise
866 self.forget(list)
867 finally:
868 wlock.release()
869
870 856 def undelete(self, list):
871 857 pctxs = self.parents()
872 858 wlock = self._repo.wlock()
General Comments 0
You need to be logged in to leave comments. Login now