Patchwork [4,of,7,VFS] subrepo: use vfs.unlink instead of os.remove

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 10, 2015, 3:54 p.m.
Message ID <32763865ec3c39afd639.1428681266@juju>
Download mbox | patch
Permalink /patch/8594/
State Accepted
Commit def1145cec2d4d674a530b377375e6d719979a5a
Headers show

Comments

Katsunori FUJIWARA - April 10, 2015, 3:54 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1428680829 -32400
#      Sat Apr 11 00:47:09 2015 +0900
# Node ID 32763865ec3c39afd639714865e8f0d9f358694e
# Parent  32d5e6dd1f7ec0a6e9f2debdb222216bf778337e
subrepo: use vfs.unlink instead of os.remove

This patch also removes useless composing absolute path by
"os.path.join()".

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1626,11 +1626,10 @@  class gitsubrepo(abstractsubrepo):
         for f, kind in self.wvfs.readdir():
             if f == '.git':
                 continue
-            path = os.path.join(self._abspath, f)
             if kind == stat.S_IFDIR:
                 self.wvfs.rmtree(f)
             else:
-                os.remove(path)
+                self.wvfs.unlink(f)
 
     def archive(self, archiver, prefix, match=None):
         total = 0