changeset 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 92ba3cd55be6
files hgext/transplant.py mercurial/hg.py mercurial/subrepo.py
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/transplant.py	Sat Sep 29 20:11:24 2012 +0900
+++ b/hgext/transplant.py	Sat Jul 28 23:28:36 2012 +0200
@@ -605,7 +605,7 @@
 
     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)
--- a/mercurial/hg.py	Sat Sep 29 20:11:24 2012 +0900
+++ b/mercurial/hg.py	Sat Jul 28 23:28:36 2012 +0200
@@ -348,7 +348,7 @@
 
             # 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:
--- a/mercurial/subrepo.py	Sat Sep 29 20:11:24 2012 +0900
+++ b/mercurial/subrepo.py	Sat Jul 28 23:28:36 2012 +0200
@@ -501,7 +501,7 @@
         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 @@
         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):