# HG changeset patch # User FUJIWARA Katsunori # Date 1365518410 -32400 # Node ID 32843795e9b395c4c58296680e4e440507447413 # Parent 0fd0612dc855cd77e5fc8e2efab8e1cc08daf4d1 summary: make "outgoing" information sensitive to branch in URL (issue3829) Before this patch, "outgoing" information of "hg summary --remote" is not sensitive to the branch specified in the URL of the destination repository, even though "hg push"/"hg outgoing" are so: Invocation of "discovery.findcommonoutgoing()" without "onlyheads" argument treats revisions on branches other than the one specified in the URL as outgoing ones unexpectedly. This patch looks head revisions, which are already detected by "hg.addbranchrevs()" from URL, up against local repository, and invokes "discovery.findcommonoutgoing()" with list of them as "onlyheads" to limit calculation of outgoing revisions. diff -r 0fd0612dc855 -r 32843795e9b3 mercurial/commands.py --- a/mercurial/commands.py Fri Mar 29 22:57:16 2013 +0900 +++ b/mercurial/commands.py Tue Apr 09 23:40:10 2013 +0900 @@ -5481,8 +5481,10 @@ other = hg.peer(repo, {}, dest) commoninc = None ui.debug('comparing with %s\n' % util.hidepassword(dest)) + if revs: + revs = [repo.lookup(rev) for rev in revs] repo.ui.pushbuffer() - outgoing = discovery.findcommonoutgoing(repo, other, + outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs, commoninc=commoninc) repo.ui.popbuffer() o = outgoing.missing diff -r 0fd0612dc855 -r 32843795e9b3 tests/test-url-rev.t --- a/tests/test-url-rev.t Fri Mar 29 22:57:16 2013 +0900 +++ b/tests/test-url-rev.t Tue Apr 09 23:40:10 2013 +0900 @@ -80,8 +80,25 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: add a + $ hg -q outgoing '../clone' + 2:faba9097cad4 + 3:4cd725637392 + $ hg summary --remote --config paths.default='../clone' + parent: 3:4cd725637392 tip + add bar + branch: default + commit: (clean) + update: (current) + remote: 2 outgoing $ hg -q outgoing '../clone#foo' 2:faba9097cad4 + $ hg summary --remote --config paths.default='../clone#foo' + parent: 3:4cd725637392 tip + add bar + branch: default + commit: (clean) + update: (current) + remote: 1 outgoing $ hg -q push '../clone#foo'