Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 24694:f282db2834f9
subrepo: use vfs.removedirs instead of os.removedirs
This patch also removes useless composing absolute path by "repo.wjoin()".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 11 Apr 2015 00:47:09 +0900 |
parents | def1145cec2d |
children | 419528cb05b6 |
comparison
equal
deleted
inserted
replaced
24693:0d28b0df77ea | 24694:f282db2834f9 |
---|---|
1113 self.ui.warn(_('not removing repo %s because ' | 1113 self.ui.warn(_('not removing repo %s because ' |
1114 'it has changes.\n') % self._path) | 1114 'it has changes.\n') % self._path) |
1115 return | 1115 return |
1116 self.ui.note(_('removing subrepo %s\n') % self._path) | 1116 self.ui.note(_('removing subrepo %s\n') % self._path) |
1117 | 1117 |
1118 path = self._ctx.repo().wjoin(self._path) | |
1119 self.wvfs.rmtree(forcibly=True) | 1118 self.wvfs.rmtree(forcibly=True) |
1120 try: | 1119 try: |
1121 os.removedirs(os.path.dirname(path)) | 1120 self._ctx.repo().wvfs.removedirs(os.path.dirname(self._path)) |
1122 except OSError: | 1121 except OSError: |
1123 pass | 1122 pass |
1124 | 1123 |
1125 @annotatesubrepoerror | 1124 @annotatesubrepoerror |
1126 def get(self, state, overwrite=False): | 1125 def get(self, state, overwrite=False): |