mercurial/commands.py
branchstable
changeset 14360 ab687820c4cc
parent 14014 42d5165975ad
child 14361 ea7081645987
child 14496 ffcb7e4d719f
--- 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