--- a/mercurial/subrepo.py Wed Nov 17 21:24:36 2010 +0100
+++ b/mercurial/subrepo.py Wed Nov 17 21:25:23 2010 +0100
@@ -564,7 +564,12 @@
os.chmod(path, stat.S_IMODE(s.st_mode) | stat.S_IWRITE)
os.remove(path)
- shutil.rmtree(self._ctx._repo.wjoin(self._path), onerror=onerror)
+ path = self._ctx._repo.wjoin(self._path)
+ shutil.rmtree(path, onerror=onerror)
+ try:
+ os.removedirs(os.path.dirname(path))
+ except OSError:
+ pass
def get(self, state):
status = self._svncommand(['checkout', state[0], '--revision', state[1]])