[issue3287] convert ignores branchmap for trunk

A. Budden bugs at mercurial.selenic.com
Mon Feb 27 05:26:12 CST 2012


New submission from A. Budden <abudden+MERCURIAL at gmail.com>:

When converting a Bazaar repository, it is likely that the user will want to
map trunk to default.  However, this is not guaranteed to be the case and it
should be possible to override this behaviour with a branch map.  If a
branch map specifies a new branch name for 'trunk', this is currently
ignored by convert:

# Make a repository for testing
$ bzr init-repo --no-trees tb
Shared repository (format: 2a)
Location:
  shared repository: tb
$ bzr init tb/trunk
Created a repository branch (format: 2a)
Using shared repository: /home/al/test/tb/
$ bzr co tb/trunk wd
$ cd wd
$ echo "abc" > abc
$ bzr add abc
adding abc
$ bzr ci -m "Commit to trunk"
Committing to: /home/al/test/tb/trunk
added abc
Committed revision 1.
$ bzr switch -b development
Tree is up to date at revision 1.
Switched to branch /home/al/test/tb/development
$ echo "def" >> abc
$ bzr ci -m "Commit to development"
Committing to: /home/al/test/tb/development
modified abc
Committed revision 2.
$ cd ..



# Convert without a branch map to check
$ hg convert tb tm_normal
initializing destination tm_normal repository
scanning source...
sorting...
converting...
1 Commit to trunk
0 Commit to default
$ cd tm_normal
$ hg log --template "{rev}:{desc}:{branch}\n"
1:Commit to development:development
0:Commit to trunk:default
# This is correct as we haven't used a branchmap
$ cd ..



# Now convert with trunk mapped to 'release' and
# development mapped to 'default'
$ echo -ne "trunk release\ndevelopment default\n" > bm
$ hg convert --branchmap bm tb tm_branchmap
initializing destination tm_branchmap repository
scanning source...
sorting...
converting...
1 Commit to trunk
0 Commit to default
$ cd tm_branchmap
$ hg log --template "{rev}:{desc}:{branch}\n"
1:Commit to development:default
0:Commit to trunk:default

# Should be:
1:Commit to development:default
0:Commit to trunk:release

----------
messages: 19182
nosy: abudden
priority: bug
status: unread
title: convert ignores branchmap for trunk

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3287>
____________________________________________________


More information about the Mercurial-devel mailing list