merge with stable
authorMartin Geisler <mg@lazybytes.net>
Wed, 18 May 2011 19:22:55 +0200
changeset 14361 ea7081645987
parent 14359 ad5c68a0db6a (current diff)
parent 14360 ab687820c4cc (diff)
child 14362 8c740a850ad7
merge with stable
mercurial/commands.py
tests/test-subrepo.t
--- a/mercurial/commands.py	Wed May 18 15:45:57 2011 +0200
+++ b/mercurial/commands.py	Wed May 18 19:22:55 2011 +0200
@@ -3202,8 +3202,13 @@
         ui.status(_('comparing with %s\n') % util.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
+
 
 @command('^init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'))
 def init(ui, dest=".", **opts):
@@ -3537,8 +3542,12 @@
         ui.status(_('comparing with %s\n') % util.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
 
 @command('parents',
     [('r', 'rev', '', _('show parents of the specified revision'), _('REV')),
--- a/tests/test-subrepo.t	Wed May 18 15:45:57 2011 +0200
+++ b/tests/test-subrepo.t	Wed May 18 19:22:55 2011 +0200
@@ -635,6 +635,26 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files
 
+Incoming and outgoing should not use the default path:
+
+  $ hg clone -q issue1852a issue1852d
+  $ hg -R issue1852d outgoing --subrepos issue1852c
+  comparing with issue1852c
+  searching for changes
+  no changes found
+  comparing with issue1852c/sub/repo
+  searching for changes
+  no changes found
+  [1]
+  $ hg -R issue1852d incoming --subrepos issue1852c
+  comparing with issue1852c
+  searching for changes
+  no changes found
+  comparing with issue1852c/sub/repo
+  searching for changes
+  no changes found
+  [1]
+
 Check status of files when none of them belong to the first
 subrepository: