# HG changeset patch # User Simon Heimberg # Date 2012-07-28 21:28:36 # Node ID 2ba70eec1cf009bacdb4a0473c149102764c9b51 # Parent 573bec4ab7ba9bec5866dee68c19bddf99e6c213 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. diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -605,7 +605,7 @@ def transplant(ui, repo, *revs, **opts): sourcerepo = opts.get('source') if sourcerepo: - peer = hg.peer(ui, opts, ui.expandpath(sourcerepo)) + peer = hg.peer(repo, opts, ui.expandpath(sourcerepo)) branches = map(peer.lookup, opts.get('branch', ())) source, csets, cleanupfn = bundlerepo.getremotechanges(ui, repo, peer, onlyheads=branches, force=True) diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -348,7 +348,7 @@ def clone(ui, peeropts, source, dest=Non # we need to re-init the repo after manually copying the data # into it - destpeer = peer(ui, peeropts, dest) + destpeer = peer(srcrepo, peeropts, dest) srcrepo.hook('outgoing', source='clone', node=node.hex(node.nullid)) else: diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -501,7 +501,7 @@ class hgsubrepo(abstractsubrepo): if revision not in self._repo: self._repo._subsource = source srcurl = _abssource(self._repo) - other = hg.peer(self._repo.ui, {}, srcurl) + other = hg.peer(self._repo, {}, srcurl) if len(self._repo) == 0: self._repo.ui.status(_('cloning subrepo %s from %s\n') % (subrelpath(self), srcurl)) @@ -566,7 +566,7 @@ class hgsubrepo(abstractsubrepo): dsturl = _abssource(self._repo, True) self._repo.ui.status(_('pushing subrepo %s to %s\n') % (subrelpath(self), dsturl)) - other = hg.peer(self._repo.ui, {'ssh': ssh}, dsturl) + other = hg.peer(self._repo, {'ssh': ssh}, dsturl) return self._repo.push(other, force, newbranch=newbranch) def outgoing(self, ui, dest, opts):