diff mercurial/commands.py @ 14360:ab687820c4cc stable

subrepo: respect non-default path for incoming/outgoing Push and pull set repo._subtoppath before pushing or pulling subrepos. The incoming and outgoing commands needed to do the same.
author Martin Geisler <mg@aragost.com>
date Wed, 18 May 2011 15:13:26 +0200
parents 42d5165975ad
children ea7081645987 ffcb7e4d719f
line wrap: on
line diff
--- a/mercurial/commands.py	Wed May 18 09:31:19 2011 +0200
+++ b/mercurial/commands.py	Wed May 18 15:13:26 2011 +0200
@@ -2516,8 +2516,13 @@
         ui.status(_('comparing with %s\n') % url.hidepassword(source))
         return bookmarks.diff(ui, repo, other)
 
-    ret = hg.incoming(ui, repo, source, opts)
-    return ret
+    repo._subtoppath = ui.expandpath(source)
+    try:
+        ret = hg.incoming(ui, repo, source, opts)
+        return ret
+    finally:
+        del repo._subtoppath
+
 
 def init(ui, dest=".", **opts):
     """create a new repository in the given directory
@@ -2803,8 +2808,12 @@
         ui.status(_('comparing with %s\n') % url.hidepassword(dest))
         return bookmarks.diff(ui, other, repo)
 
-    ret = hg.outgoing(ui, repo, dest, opts)
-    return ret
+    repo._subtoppath = ui.expandpath(dest or 'default-push', dest or 'default')
+    try:
+        ret = hg.outgoing(ui, repo, dest, opts)
+        return ret
+    finally:
+        del repo._subtoppath
 
 def parents(ui, repo, file_=None, **opts):
     """show the parents of the working directory or revision