changeset 17875:92ba3cd55be6 stable

subrepo: more isolation, only use ui for hg.peer when there is no repo ui contains repo specific configuration, so do not use it when there is a repo. But pass it to hg.peer when there is no repo. Then it only contains global configuration.
author Simon Heimberg <simohe@besonet.ch>
date Thu, 04 Oct 2012 19:46:43 +0200
parents 2ba70eec1cf0
children f4ee2e959696
files mercurial/commands.py mercurial/hg.py
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Jul 28 23:28:36 2012 +0200
+++ b/mercurial/commands.py	Thu Oct 04 19:46:43 2012 +0200
@@ -3538,7 +3538,7 @@
 
     if source:
         source, branches = hg.parseurl(ui.expandpath(source))
-        peer = hg.peer(ui, opts, source)
+        peer = hg.peer(repo or ui, opts, source) # only pass ui when no repo
         repo = peer.local()
         revs, checkout = hg.addbranchrevs(repo, peer, branches, None)
 
--- a/mercurial/hg.py	Sat Jul 28 23:28:36 2012 +0200
+++ b/mercurial/hg.py	Thu Oct 04 19:46:43 2012 +0200
@@ -353,7 +353,8 @@
                           node=node.hex(node.nullid))
         else:
             try:
-                destpeer = peer(ui, peeropts, dest, create=True)
+                destpeer = peer(srcrepo or ui, peeropts, dest, create=True)
+                                # only pass ui when no srcrepo
             except OSError, inst:
                 if inst.errno == errno.EEXIST:
                     dircleanup.close()