##// 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 if not os.path.isdir(targetdir):
281 if not os.path.isdir(targetdir):
282 os.makedirs(targetdir)
282 os.makedirs(targetdir)
283 util.copyfile(src, target)
283 util.copyfile(src, target)
284 srcexists = True
284 except IOError, inst:
285 except IOError, inst:
285 if inst.errno == errno.ENOENT:
286 if inst.errno == errno.ENOENT:
286 ui.warn(_('%s: deleted in working copy\n') % relsrc)
287 ui.warn(_('%s: deleted in working copy\n') % relsrc)
288 srcexists = False
287 else:
289 else:
288 ui.warn(_('%s: cannot copy - %s\n') %
290 ui.warn(_('%s: cannot copy - %s\n') %
289 (relsrc, inst.strerror))
291 (relsrc, inst.strerror))
@@ -301,7 +303,9 b' def copy(ui, repo, pats, opts, rename=Fa'
301 scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
303 scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
302 dryrun=dryrun, cwd=cwd)
304 dryrun=dryrun, cwd=cwd)
303 if rename and not dryrun:
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 # pat: ossep
310 # pat: ossep
307 # dest ossep
311 # dest ossep
@@ -853,20 +853,6 b' class workingctx(changectx):'
853 *[p.rev() for p in self._parents]):
853 *[p.rev() for p in self._parents]):
854 yield changectx(self._repo, a)
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 def undelete(self, list):
856 def undelete(self, list):
871 pctxs = self.parents()
857 pctxs = self.parents()
872 wlock = self._repo.wlock()
858 wlock = self._repo.wlock()
General Comments 0
You need to be logged in to leave comments. Login now