comparison mercurial/subrepo.py @ 17874:2ba70eec1cf0 stable

peer: subrepo isolation, pass repo instead of repo.ui to hg.peer Do not pass ui because it contains the configuration of the repo. It is the same object as repo.ui. When a repo is passed to hg.peer, the global configuration is read from repo.baseui.
author Simon Heimberg <simohe@besonet.ch>
date Sat, 28 Jul 2012 23:28:36 +0200
parents 573bec4ab7ba
children f4ee2e959696
comparison
equal deleted inserted replaced
17873:573bec4ab7ba 17874:2ba70eec1cf0
499 def _get(self, state): 499 def _get(self, state):
500 source, revision, kind = state 500 source, revision, kind = state
501 if revision not in self._repo: 501 if revision not in self._repo:
502 self._repo._subsource = source 502 self._repo._subsource = source
503 srcurl = _abssource(self._repo) 503 srcurl = _abssource(self._repo)
504 other = hg.peer(self._repo.ui, {}, srcurl) 504 other = hg.peer(self._repo, {}, srcurl)
505 if len(self._repo) == 0: 505 if len(self._repo) == 0:
506 self._repo.ui.status(_('cloning subrepo %s from %s\n') 506 self._repo.ui.status(_('cloning subrepo %s from %s\n')
507 % (subrelpath(self), srcurl)) 507 % (subrelpath(self), srcurl))
508 parentrepo = self._repo._subparent 508 parentrepo = self._repo._subparent
509 shutil.rmtree(self._repo.path) 509 shutil.rmtree(self._repo.path)
564 return False 564 return False
565 565
566 dsturl = _abssource(self._repo, True) 566 dsturl = _abssource(self._repo, True)
567 self._repo.ui.status(_('pushing subrepo %s to %s\n') % 567 self._repo.ui.status(_('pushing subrepo %s to %s\n') %
568 (subrelpath(self), dsturl)) 568 (subrelpath(self), dsturl))
569 other = hg.peer(self._repo.ui, {'ssh': ssh}, dsturl) 569 other = hg.peer(self._repo, {'ssh': ssh}, dsturl)
570 return self._repo.push(other, force, newbranch=newbranch) 570 return self._repo.push(other, force, newbranch=newbranch)
571 571
572 def outgoing(self, ui, dest, opts): 572 def outgoing(self, ui, dest, opts):
573 return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts) 573 return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts)
574 574