Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 13015:82ca0c43bc44 stable
subrepo: prune empty directories when removing svn subrepo
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 17 Nov 2010 21:25:23 +0100 |
parents | d1c52354b0a9 |
children | 9efc316a6716 d0e21c5fde41 |
comparison
equal
deleted
inserted
replaced
13014:d1c52354b0a9 | 13015:82ca0c43bc44 |
---|---|
562 if (s.st_mode & stat.S_IWRITE) != 0: | 562 if (s.st_mode & stat.S_IWRITE) != 0: |
563 raise | 563 raise |
564 os.chmod(path, stat.S_IMODE(s.st_mode) | stat.S_IWRITE) | 564 os.chmod(path, stat.S_IMODE(s.st_mode) | stat.S_IWRITE) |
565 os.remove(path) | 565 os.remove(path) |
566 | 566 |
567 shutil.rmtree(self._ctx._repo.wjoin(self._path), onerror=onerror) | 567 path = self._ctx._repo.wjoin(self._path) |
568 shutil.rmtree(path, onerror=onerror) | |
569 try: | |
570 os.removedirs(os.path.dirname(path)) | |
571 except OSError: | |
572 pass | |
568 | 573 |
569 def get(self, state): | 574 def get(self, state): |
570 status = self._svncommand(['checkout', state[0], '--revision', state[1]]) | 575 status = self._svncommand(['checkout', state[0], '--revision', state[1]]) |
571 if not re.search('Checked out revision [0-9]+.', status): | 576 if not re.search('Checked out revision [0-9]+.', status): |
572 raise util.Abort(status.splitlines()[-1]) | 577 raise util.Abort(status.splitlines()[-1]) |