Convert bzr

Giorgos Keramidas gkeramidas at gmail.com
Sun Dec 16 22:31:06 UTC 2012


On Sun, 16 Dec 2012 13:55:33 -0800, Adrian Klaver <adrian.klaver at gmail.com> wrote:
>On 12/16/2012 01:39 PM, Giorgos Keramidas wrote:
>>On Sun, 16 Dec 2012 12:52:54 -0800, Adrian Klaver <adrian.klaver at gmail.com> wrote:
>>> I started with this repo because it was small and simple:) After my
>>> last email I decided to run convert against some larger repos and it
>>> worked. I was in the process of trying to figure out wht when your
>>> email landed. Thanks.
>>
>> Aha! It seems that hg convert added a tag update commit on the 'default'
>> branch, right after it converted everything else to be on the 'aws'
>> branch from the original repository — exactly like Patrick said.
>
> So why would that happen? I did not see that happen on other repos I
> converted.

I can only guess without looking at the actual conversion command and
the source repository. It's possible that the rest of the repositories
had a different branching scheme / setup and this one confused the
convert extension.  If this is true, we may be looking at a bug or
edge-case that convert needs to handle better.

>> You can fix this for now by cloning the 'aws' branch only of the
>> converted repository, and rerunning the conversion script with the
>> convert.hg.tagsbranch option, to make sure tag updates happen in the
>> 'aws' branch by default:
>>
>>      hg clone -b aws aws-hg aws-hg-fixed
>>      hg convert --config convert.hg.tagsbranch='aws'    \
>>          SOURCE-BZR-REPOSITORY                          \
>>          aws-hg-fixed
>>
>> Now the 'aws-hg-fixed' repository should have the tags in the 'aws'
>> branch, and only one branch.
>
> Well I figured out how to make a clone up to the revision before the
> tag_update commit. Would it be enough just work off that clone
> assuming I needed no reference back to the original bzr repo? In other
> words I did not need to run convert again.

Ok, that's all good then. The -b BRANCH option of 'clone' should do this
easily (just in case you happen to need something similar in the
future).  If you don't plan to re-run the conversion for incremental
updates, you're done.  Just use the converted repository for the rest of
your work.

A word of caution though: It's often a good idea to use the 'default'
branch instead of a single non-default branch in a Mercurial
repository.  It may be more useful now that you know what's happening to
re-run the conversion and map the 'aws' branch into 'default', by using
the '--branchmap FILE' option of 'hg convert'.

This way, if you later start using the 'default' branch as the mainline
of development and named branches for other purposes (e.g. release
branches, or something similar), you won't have to special-case the
'aws' name vs. other named branches.  It will not even be there, and
your mainline will just be the 'default' branch.

Cheers,
Giorgos




More information about the Mercurial mailing list