Bug 3828 - "hg bundle --branch" fails for branches newly created on local repository
Summary: "hg bundle --branch" fails for branches newly created on local repository
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:31 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:31 UTC
"hg bundle --branch foo other-repo" fails, if "foo" is created newly
on local repository.

this can be reproduced by script below:

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

    hg clone src dst

    hg -R src update 0
    hg -R src branch foo
    hg -R src commit -m '#2'

    hg -R src bundle --branch foo foo.hg dst
Comment 1 HG Bot 2013-02-22 15:00 UTC
Fixed by http://selenic.com/repo/hg/rev/61c8327ced50
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
bundle: treat branches created newly on the local correctly (issue3828)

Before this patch, "hg bundle --branch foo other" fails to create
bundle file, if specified "foo" branch is created newly on the local
repository.

"hg bundle" uses "hg.addbranchrevs(repo, other, ...)" to look branch
names up, even though other outgoing-like implementation uses
"hg.addbranchrevs(repo, repo, ...)". In the former invocation, "other"
repository recognizes such branches as unknown, so execution is
aborted.

This patch uses "hg.addbranchrevs(repo, repo, ..)" in "hg bundle" to
bundle revisions on such branches correctly.

(please test the fix)