changeset 18994:32843795e9b3

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 09 Apr 2013 23:40:10 +0900
parents 0fd0612dc855
children 0023a6e49268
files mercurial/commands.py tests/test-url-rev.t
diffstat 2 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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'