[PATCH 4 of 7 VFS] subrepo: use vfs.unlink instead of os.remove
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Fri Apr 10 10:54:26 CDT 2015
# HG changeset patch
# User FUJIWARA Katsunori <foozy at 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()".
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
More information about the Mercurial-devel
mailing list