980 srcurl = _abssource(self._repo) |
980 srcurl = _abssource(self._repo) |
981 other = hg.peer(self._repo, {}, srcurl) |
981 other = hg.peer(self._repo, {}, srcurl) |
982 if len(self._repo) == 0: |
982 if len(self._repo) == 0: |
983 # use self._repo.vfs instead of self.wvfs to remove .hg only |
983 # use self._repo.vfs instead of self.wvfs to remove .hg only |
984 self._repo.vfs.rmtree() |
984 self._repo.vfs.rmtree() |
985 if parentrepo.shared(): |
985 |
|
986 # A remote subrepo could be shared if there is a local copy |
|
987 # relative to the parent's share source. But clone pooling doesn't |
|
988 # assemble the repos in a tree, so that can't be consistently done. |
|
989 # A simpler option is for the user to configure clone pooling, and |
|
990 # work with that. |
|
991 if parentrepo.shared() and hg.islocal(srcurl): |
986 self.ui.status(_('sharing subrepo %s from %s\n') |
992 self.ui.status(_('sharing subrepo %s from %s\n') |
987 % (subrelpath(self), srcurl)) |
993 % (subrelpath(self), srcurl)) |
988 shared = hg.share(self._repo._subparent.baseui, |
994 shared = hg.share(self._repo._subparent.baseui, |
989 other, self._repo.root, |
995 other, self._repo.root, |
990 update=False, bookmarks=False) |
996 update=False, bookmarks=False) |