# HG changeset patch # User Martin Geisler # Date 1305739375 -7200 # Node ID ea70816459876f69571fe9ce41cddfc32fd80fd5 # Parent ad5c68a0db6ae578cf7e0154f7209e2e10ee2b2b# Parent ab687820c4cc81d7551c08e2692820838cb2a984 merge with stable diff -r ad5c68a0db6a -r ea7081645987 mercurial/commands.py --- 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')), diff -r ad5c68a0db6a -r ea7081645987 tests/test-subrepo.t --- 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: