[PATCH 5 of 5] more subrepo isolation, only use ui for hg.peer when there is no repo

Simon Heimberg simohe at besonet.ch
Thu Oct 4 22:03:02 CDT 2012


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1349372803 -7200
# Node ID 72fbe15c1c09f4064fb6d343006ae5b71b406f23
# Parent  4b16cabe900348d9fe7ecf6cb56a1e84b7137e64
more subrepo isolation, only use ui for hg.peer when there is no repo

ui contains repo specific configuration, but only if there is a repo

diff -r 4b16cabe9003 -r 72fbe15c1c09 mercurial/commands.py
--- a/mercurial/commands.py	Sam Jul 28 23:28:36 2012 +0200
+++ b/mercurial/commands.py	Don Okt 04 19:46:43 2012 +0200
@@ -3497,7 +3497,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)
 
diff -r 4b16cabe9003 -r 72fbe15c1c09 mercurial/hg.py
--- a/mercurial/hg.py	Sam Jul 28 23:28:36 2012 +0200
+++ b/mercurial/hg.py	Don Okt 04 19:46:43 2012 +0200
@@ -343,7 +343,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()


More information about the Mercurial-devel mailing list