##// END OF EJS Templates
vfs: use repo.wvfs.unlinkpath
Mads Kiilerich -
r31309:8908f985 default
parent child Browse files
Show More
@@ -223,7 +223,7 def removelargefiles(ui, repo, isaddremo
223
223
224 if not opts.get('dry_run'):
224 if not opts.get('dry_run'):
225 if not after:
225 if not after:
226 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
226 repo.wvfs.unlinkpath(f, ignoremissing=True)
227
227
228 if opts.get('dry_run'):
228 if opts.get('dry_run'):
229 return result
229 return result
@@ -233,7 +233,7 def removelargefiles(ui, repo, isaddremo
233 # function handle this.
233 # function handle this.
234 if not isaddremove:
234 if not isaddremove:
235 for f in remove:
235 for f in remove:
236 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
236 repo.wvfs.unlinkpath(f, ignoremissing=True)
237 repo[None].forget(remove)
237 repo[None].forget(remove)
238
238
239 for f in remove:
239 for f in remove:
@@ -694,7 +694,7 def overridecopy(orig, ui, repo, pats, o
694
694
695 # The file is gone, but this deletes any empty parent
695 # The file is gone, but this deletes any empty parent
696 # directories as a side-effect.
696 # directories as a side-effect.
697 util.unlinkpath(repo.wjoin(srclfile), True)
697 repo.wvfs.unlinkpath(srclfile, ignoremissing=True)
698 lfdirstate.remove(srclfile)
698 lfdirstate.remove(srclfile)
699 else:
699 else:
700 util.copyfile(repo.wjoin(srclfile),
700 util.copyfile(repo.wjoin(srclfile),
@@ -1096,7 +1096,7 def cmdutilforget(orig, ui, repo, match,
1096 lfdirstate.write()
1096 lfdirstate.write()
1097 standins = [lfutil.standin(f) for f in forget]
1097 standins = [lfutil.standin(f) for f in forget]
1098 for f in standins:
1098 for f in standins:
1099 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
1099 repo.wvfs.unlinkpath(f, ignoremissing=True)
1100 rejected = repo[None].forget(standins)
1100 rejected = repo[None].forget(standins)
1101
1101
1102 bad.extend(f for f in rejected if f in m.files())
1102 bad.extend(f for f in rejected if f in m.files())
@@ -1479,7 +1479,7 class queue(object):
1479 # created while patching
1479 # created while patching
1480 for f in all_files:
1480 for f in all_files:
1481 if f not in repo.dirstate:
1481 if f not in repo.dirstate:
1482 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
1482 repo.wvfs.unlinkpath(f, ignoremissing=True)
1483 self.ui.warn(_('done\n'))
1483 self.ui.warn(_('done\n'))
1484 raise
1484 raise
1485
1485
@@ -1582,7 +1582,7 class queue(object):
1582 self.backup(repo, tobackup)
1582 self.backup(repo, tobackup)
1583 repo.dirstate.beginparentchange()
1583 repo.dirstate.beginparentchange()
1584 for f in a:
1584 for f in a:
1585 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
1585 repo.wvfs.unlinkpath(f, ignoremissing=True)
1586 repo.dirstate.drop(f)
1586 repo.dirstate.drop(f)
1587 for f in m + r:
1587 for f in m + r:
1588 fctx = ctx[f]
1588 fctx = ctx[f]
@@ -728,7 +728,7 def copy(ui, repo, pats, opts, rename=Fa
728 dryrun=dryrun, cwd=cwd)
728 dryrun=dryrun, cwd=cwd)
729 if rename and not dryrun:
729 if rename and not dryrun:
730 if not after and srcexists and not samefile:
730 if not after and srcexists and not samefile:
731 util.unlinkpath(repo.wjoin(abssrc))
731 repo.wvfs.unlinkpath(abssrc)
732 wctx.forget([abssrc])
732 wctx.forget([abssrc])
733
733
734 # pat: ossep
734 # pat: ossep
@@ -2474,7 +2474,7 def remove(ui, repo, m, prefix, after, f
2474 for f in list:
2474 for f in list:
2475 if f in added:
2475 if f in added:
2476 continue # we never unlink added files on remove
2476 continue # we never unlink added files on remove
2477 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
2477 repo.wvfs.unlinkpath(f, ignoremissing=True)
2478 repo[None].forget(list)
2478 repo[None].forget(list)
2479
2479
2480 if warn:
2480 if warn:
@@ -3199,7 +3199,7 def _performrevert(repo, parents, ctx, a
3199
3199
3200 def doremove(f):
3200 def doremove(f):
3201 try:
3201 try:
3202 util.unlinkpath(repo.wjoin(f))
3202 repo.wvfs.unlinkpath(f)
3203 except OSError:
3203 except OSError:
3204 pass
3204 pass
3205 repo.dirstate.remove(f)
3205 repo.dirstate.remove(f)
@@ -1770,7 +1770,7 class workingfilectx(committablefilectx)
1770
1770
1771 def remove(self, ignoremissing=False):
1771 def remove(self, ignoremissing=False):
1772 """wraps unlink for a repo's working directory"""
1772 """wraps unlink for a repo's working directory"""
1773 util.unlinkpath(self._repo.wjoin(self._path), ignoremissing)
1773 self._repo.wvfs.unlinkpath(self._path, ignoremissing=ignoremissing)
1774
1774
1775 def write(self, data, flags):
1775 def write(self, data, flags):
1776 """wraps repo.wwrite"""
1776 """wraps repo.wwrite"""
@@ -1190,7 +1190,7 def applyupdates(repo, actions, wctx, mc
1190 if os.path.lexists(repo.wjoin(f)):
1190 if os.path.lexists(repo.wjoin(f)):
1191 repo.ui.debug("removing %s\n" % f)
1191 repo.ui.debug("removing %s\n" % f)
1192 audit(f)
1192 audit(f)
1193 util.unlinkpath(repo.wjoin(f))
1193 repo.wvfs.unlinkpath(f)
1194
1194
1195 numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
1195 numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
1196
1196
@@ -1247,7 +1247,7 def applyupdates(repo, actions, wctx, mc
1247 repo.ui.note(_("moving %s to %s\n") % (f0, f))
1247 repo.ui.note(_("moving %s to %s\n") % (f0, f))
1248 audit(f)
1248 audit(f)
1249 repo.wwrite(f, wctx.filectx(f0).data(), flags)
1249 repo.wwrite(f, wctx.filectx(f0).data(), flags)
1250 util.unlinkpath(repo.wjoin(f0))
1250 repo.wvfs.unlinkpath(f0)
1251 updated += 1
1251 updated += 1
1252
1252
1253 # local directory rename, get
1253 # local directory rename, get
@@ -224,7 +224,7 class abstractvfs(object):
224 return util.unlink(self.join(path))
224 return util.unlink(self.join(path))
225
225
226 def unlinkpath(self, path=None, ignoremissing=False):
226 def unlinkpath(self, path=None, ignoremissing=False):
227 return util.unlinkpath(self.join(path), ignoremissing)
227 return util.unlinkpath(self.join(path), ignoremissing=ignoremissing)
228
228
229 def utime(self, path=None, t=None):
229 def utime(self, path=None, t=None):
230 return os.utime(self.join(path), t)
230 return os.utime(self.join(path), t)
General Comments 0
You need to be logged in to leave comments. Login now