Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 15287:b3e19c355ca7 stable
subrepo: abort in hgsubrepo._get if the destination is obstructed
Before, we deleted foo when we determined that there were zero
changesets in the foo subrepo. Any files in foo was deleted too. We
now delete foo/.hg instead, and the normal checks in hg.clone will
then abort if there are untracked files in foo.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 17 Oct 2011 18:01:38 +0200 |
parents | 4be845e3932c |
children | 9e99d2bbb1b1 ac5a340b26de |
comparison
equal
deleted
inserted
replaced
15286:4be845e3932c | 15287:b3e19c355ca7 |
---|---|
465 other = hg.peer(self._repo.ui, {}, srcurl) | 465 other = hg.peer(self._repo.ui, {}, srcurl) |
466 if len(self._repo) == 0: | 466 if len(self._repo) == 0: |
467 self._repo.ui.status(_('cloning subrepo %s from %s\n') | 467 self._repo.ui.status(_('cloning subrepo %s from %s\n') |
468 % (subrelpath(self), srcurl)) | 468 % (subrelpath(self), srcurl)) |
469 parentrepo = self._repo._subparent | 469 parentrepo = self._repo._subparent |
470 shutil.rmtree(self._repo.root) | 470 shutil.rmtree(self._repo.path) |
471 other, self._repo = hg.clone(self._repo._subparent.ui, {}, other, | 471 other, self._repo = hg.clone(self._repo._subparent.ui, {}, other, |
472 self._repo.root, update=False) | 472 self._repo.root, update=False) |
473 self._initrepo(parentrepo, source, create=True) | 473 self._initrepo(parentrepo, source, create=True) |
474 else: | 474 else: |
475 self._repo.ui.status(_('pulling subrepo %s from %s\n') | 475 self._repo.ui.status(_('pulling subrepo %s from %s\n') |