subrepo: use vfs.removedirs instead of os.removedirs
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sat, 11 Apr 2015 00:47:09 +0900
changeset 24694 f282db2834f9
parent 24693 0d28b0df77ea
child 24695 419528cb05b6
subrepo: use vfs.removedirs instead of os.removedirs This patch also removes useless composing absolute path by "repo.wjoin()".
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Sat Apr 11 00:47:09 2015 +0900
+++ b/mercurial/subrepo.py	Sat Apr 11 00:47:09 2015 +0900
@@ -1115,10 +1115,9 @@
             return
         self.ui.note(_('removing subrepo %s\n') % self._path)
 
-        path = self._ctx.repo().wjoin(self._path)
         self.wvfs.rmtree(forcibly=True)
         try:
-            os.removedirs(os.path.dirname(path))
+            self._ctx.repo().wvfs.removedirs(os.path.dirname(self._path))
         except OSError:
             pass