vfs: use repo.wvfs.unlinkpath
authorMads Kiilerich <madski@unity3d.com>
Wed, 14 Jan 2015 01:15:26 +0100
changeset 31309 8908f985570c
parent 31308 62939e0148f1
child 31310 431d4f73249e
vfs: use repo.wvfs.unlinkpath
hgext/largefiles/overrides.py
hgext/mq.py
mercurial/cmdutil.py
mercurial/context.py
mercurial/merge.py
mercurial/vfs.py
--- a/hgext/largefiles/overrides.py	Wed Mar 08 18:11:41 2017 -0500
+++ b/hgext/largefiles/overrides.py	Wed Jan 14 01:15:26 2015 +0100
@@ -223,7 +223,7 @@
 
             if not opts.get('dry_run'):
                 if not after:
-                    util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+                    repo.wvfs.unlinkpath(f, ignoremissing=True)
 
         if opts.get('dry_run'):
             return result
@@ -233,7 +233,7 @@
         # function handle this.
         if not isaddremove:
             for f in remove:
-                util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+                repo.wvfs.unlinkpath(f, ignoremissing=True)
         repo[None].forget(remove)
 
         for f in remove:
@@ -694,7 +694,7 @@
 
                     # The file is gone, but this deletes any empty parent
                     # directories as a side-effect.
-                    util.unlinkpath(repo.wjoin(srclfile), True)
+                    repo.wvfs.unlinkpath(srclfile, ignoremissing=True)
                     lfdirstate.remove(srclfile)
                 else:
                     util.copyfile(repo.wjoin(srclfile),
@@ -1096,7 +1096,7 @@
         lfdirstate.write()
         standins = [lfutil.standin(f) for f in forget]
         for f in standins:
-            util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+            repo.wvfs.unlinkpath(f, ignoremissing=True)
         rejected = repo[None].forget(standins)
 
     bad.extend(f for f in rejected if f in m.files())
--- a/hgext/mq.py	Wed Mar 08 18:11:41 2017 -0500
+++ b/hgext/mq.py	Wed Jan 14 01:15:26 2015 +0100
@@ -1479,7 +1479,7 @@
                 # created while patching
                 for f in all_files:
                     if f not in repo.dirstate:
-                        util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+                        repo.wvfs.unlinkpath(f, ignoremissing=True)
                 self.ui.warn(_('done\n'))
                 raise
 
@@ -1582,7 +1582,7 @@
                 self.backup(repo, tobackup)
                 repo.dirstate.beginparentchange()
                 for f in a:
-                    util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+                    repo.wvfs.unlinkpath(f, ignoremissing=True)
                     repo.dirstate.drop(f)
                 for f in m + r:
                     fctx = ctx[f]
--- a/mercurial/cmdutil.py	Wed Mar 08 18:11:41 2017 -0500
+++ b/mercurial/cmdutil.py	Wed Jan 14 01:15:26 2015 +0100
@@ -728,7 +728,7 @@
                              dryrun=dryrun, cwd=cwd)
         if rename and not dryrun:
             if not after and srcexists and not samefile:
-                util.unlinkpath(repo.wjoin(abssrc))
+                repo.wvfs.unlinkpath(abssrc)
             wctx.forget([abssrc])
 
     # pat: ossep
@@ -2474,7 +2474,7 @@
             for f in list:
                 if f in added:
                     continue # we never unlink added files on remove
-                util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+                repo.wvfs.unlinkpath(f, ignoremissing=True)
         repo[None].forget(list)
 
     if warn:
@@ -3199,7 +3199,7 @@
 
     def doremove(f):
         try:
-            util.unlinkpath(repo.wjoin(f))
+            repo.wvfs.unlinkpath(f)
         except OSError:
             pass
         repo.dirstate.remove(f)
--- a/mercurial/context.py	Wed Mar 08 18:11:41 2017 -0500
+++ b/mercurial/context.py	Wed Jan 14 01:15:26 2015 +0100
@@ -1770,7 +1770,7 @@
 
     def remove(self, ignoremissing=False):
         """wraps unlink for a repo's working directory"""
-        util.unlinkpath(self._repo.wjoin(self._path), ignoremissing)
+        self._repo.wvfs.unlinkpath(self._path, ignoremissing=ignoremissing)
 
     def write(self, data, flags):
         """wraps repo.wwrite"""
--- a/mercurial/merge.py	Wed Mar 08 18:11:41 2017 -0500
+++ b/mercurial/merge.py	Wed Jan 14 01:15:26 2015 +0100
@@ -1190,7 +1190,7 @@
         if os.path.lexists(repo.wjoin(f)):
             repo.ui.debug("removing %s\n" % f)
             audit(f)
-            util.unlinkpath(repo.wjoin(f))
+            repo.wvfs.unlinkpath(f)
 
     numupdates = sum(len(l) for m, l in actions.items() if m != 'k')
 
@@ -1247,7 +1247,7 @@
         repo.ui.note(_("moving %s to %s\n") % (f0, f))
         audit(f)
         repo.wwrite(f, wctx.filectx(f0).data(), flags)
-        util.unlinkpath(repo.wjoin(f0))
+        repo.wvfs.unlinkpath(f0)
         updated += 1
 
     # local directory rename, get
--- a/mercurial/vfs.py	Wed Mar 08 18:11:41 2017 -0500
+++ b/mercurial/vfs.py	Wed Jan 14 01:15:26 2015 +0100
@@ -224,7 +224,7 @@
         return util.unlink(self.join(path))
 
     def unlinkpath(self, path=None, ignoremissing=False):
-        return util.unlinkpath(self.join(path), ignoremissing)
+        return util.unlinkpath(self.join(path), ignoremissing=ignoremissing)
 
     def utime(self, path=None, t=None):
         return os.utime(self.join(path), t)