[PATCH 6 of 6] subrepo: use vfs.dirname instead of os.path.dirname

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Jul 9 11:03:03 CDT 2015


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1436457591 -32400
#      Fri Jul 10 00:59:51 2015 +0900
# Node ID 9f0ccb59226a2e171369c9223e61e6747554bbe4
# Parent  819896ff7ffd53404f41832f890f1c3603cf5a49
subrepo: use vfs.dirname instead of os.path.dirname

This patch uses "wvfs of the parent repository" ('pwvfs') instead of
'wvfs' of own repository, because 'self._path' is the path to this
subrepository as seen from the parent repository.

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1206,7 +1206,8 @@ class svnsubrepo(abstractsubrepo):
 
         self.wvfs.rmtree(forcibly=True)
         try:
-            self._ctx.repo().wvfs.removedirs(os.path.dirname(self._path))
+            pwvfs = self._ctx.repo().wvfs
+            pwvfs.removedirs(pwvfs.dirname(self._path))
         except OSError:
             pass
 


More information about the Mercurial-devel mailing list