Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 14556:517e1d88bf7e
hg: change various repository() users to use peer() where appropriate
This gets all the easy cases (peers that aren't also used as repositories).
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 10 Jun 2011 11:43:38 -0500 |
parents | d976542986d2 |
children | 0ae98cd2a83f |
comparison
equal
deleted
inserted
replaced
14555:1ceb2cf9f9d9 | 14556:517e1d88bf7e |
---|---|
435 def _get(self, state): | 435 def _get(self, state): |
436 source, revision, kind = state | 436 source, revision, kind = state |
437 if revision not in self._repo: | 437 if revision not in self._repo: |
438 self._repo._subsource = source | 438 self._repo._subsource = source |
439 srcurl = _abssource(self._repo) | 439 srcurl = _abssource(self._repo) |
440 other = hg.repository(self._repo.ui, srcurl) | 440 other = hg.peer(self._repo.ui, {}, srcurl) |
441 if len(self._repo) == 0: | 441 if len(self._repo) == 0: |
442 self._repo.ui.status(_('cloning subrepo %s from %s\n') | 442 self._repo.ui.status(_('cloning subrepo %s from %s\n') |
443 % (subrelpath(self), srcurl)) | 443 % (subrelpath(self), srcurl)) |
444 parentrepo = self._repo._subparent | 444 parentrepo = self._repo._subparent |
445 shutil.rmtree(self._repo.root) | 445 shutil.rmtree(self._repo.root) |
493 return False | 493 return False |
494 | 494 |
495 dsturl = _abssource(self._repo, True) | 495 dsturl = _abssource(self._repo, True) |
496 self._repo.ui.status(_('pushing subrepo %s to %s\n') % | 496 self._repo.ui.status(_('pushing subrepo %s to %s\n') % |
497 (subrelpath(self), dsturl)) | 497 (subrelpath(self), dsturl)) |
498 other = hg.repository(self._repo.ui, dsturl) | 498 other = hg.peer(self._repo.ui, {}, dsturl) |
499 return self._repo.push(other, force) | 499 return self._repo.push(other, force) |
500 | 500 |
501 def outgoing(self, ui, dest, opts): | 501 def outgoing(self, ui, dest, opts): |
502 return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts) | 502 return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts) |
503 | 503 |