Bug 3829 - some outgoing-like commands are not sensitive to branch specified in URL
Summary: some outgoing-like commands are not sensitive to branch specified in URL
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-17 05:51 UTC by FUJIWARA Katsunori
Modified: 2017-11-01 18:05 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description FUJIWARA Katsunori 2013-02-17 05:51 UTC
"hg summary --remote" is not sensitive to the branch specified in
destination URL, even though "hg push"/"hg outgoing" are so.

this can be reproduced by script below:

    hg init src
    echo a > src/a
    hg -R src commit -Am '#0'

    hg clone src dst

    echo b > src/b
    hg -R src commit -Am '#1'
    hg -R src branch foo
    hg -R src commit -m '#2'

    echo "==== 2 outgoings should be in whole history ===="
    hg -R src outgoing dst
    hg -R src summary --remote --config paths.default=dst

    echo "==== 1 outgoing should be in default branch ===="
    hg -R src outgoing "dst#default"
    hg -R src summary --remote --config paths.default="dst#default"

In above script, "hg sumary --remote" for "dst#default" will
show "remote: 2 outgoing", even though there is only one outgoing
revision on "default" branch.

"hg histedit --outgoing" is not sensitive, too.
Comment 1 HG Bot 2013-04-16 20:15 UTC
Fixed by http://selenic.com/repo/hg/rev/32843795e9b3
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
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.

(please test the fix)