Converting a Bazaar Repository

A. S. Budden abudden at gmail.com
Tue Jan 31 17:56:02 UTC 2012


On 31 January 2012 16:09, Patrick Mézard <pmezard at gmail.com> wrote:
> Le 31/01/12 16:28, A. S. Budden a écrit :
>> On 30 January 2012 18:02, Patrick Mézard <pmezard at gmail.com> wrote:
>>> Le 30/01/12 16:20, A. S. Budden a écrit :
>>>> On 30 January 2012 13:03, Patrick Mézard <pmezard at gmail.com> wrote:
>>>>> Le 30/01/12 09:31, A. S. Budden a écrit :
>>>>>> Dear all,
>>>>>>
>>>>>> Is there any way to convert a Bazaar repository to Mercurial?  I've
>>>>>> been playing around with the convert extension, but it only seems to
>>>>>> be able to convert individual branches.  It also seems to lose the
>>>>>> names of the branches from the history, which is a bit of a shame, but
>>>>>> not a massive problem.
>>>>>>
>>>>>> I have a shared repository with about twenty branches, of which about
>>>>>> four are active.  I'd really like to convert this into a single
>>>>>> Mercurial repository with at least the four branches all present, but
>>>>>> I haven't figured out an obvious way to achieve this.  I wondered if
>>>>>> it might be a case of converting each branch individually into a
>>>>>> separate Mercurial repository and then combining them (but not merging
>>>>>> them) somehow (preserving names except for changing 'trunk' into
>>>>>> 'default'), but I haven't figured out how to do that either!
>>>>>>
>>>>>> Has anyone got any experience of this?
>>>>>
>>>>> Could you find (or build) a public (small) bzr repository to reproduce this problem? There are few people with both knowledge about convert internals and bzr ones so any help is welcome.
>>>>
>>>> To be honest, I'm not sure... Launchpad (the only public hosting I
>>>> know of for Bazaar) uses a different branching method, so I don't
>>>> think this is particularly valid.  That was why I included a list of
>>>> commands at the end of the email showing how to reproduce the problem.
>>>>  If the mailing list allows attachments, I guess I could create a
>>>> repository, zip it up and send it to the list: would that be helpful?
>>>
>>> I have attached a quick patch to handle this in the bug tracker, could you give it a try (and continue the discussion there)?
>>>
>>>  http://mercurial.selenic.com/bts/issue3229
>>
>> The conversion is now proceeding very well (I'm auto-converting 88
>> repositories), including (with my own script) auto-converting
>> .bzrignore to .hgignore (by adding syntax: glob to the start) and
>> converting Bazaar externals configuration to Mercurial subrepos (quite
>> messy, but seems to be working okay-ish).
>>
>> I have, however, come across a couple of other situations that cause
>> Mercurial to produce unknown exceptions.  One of these is where we
>> have (for reasons I don't really know) empty repositories: if there
>> are no changes convert crashes.  Not a major issue by any means (just
>> makes my logs look a little messy!).  The more serious issue is where
>> there are non-ascii characters in commit messages: Mercurial crashes
>> and hence the conversion fails.  I've posted a bug report at:
>>
>>     http://mercurial.selenic.com/bts/issue3232
>
> Great, I am looking into it. Please open other issues for the empty case or anything else you might have seen.

Done: http://mercurial.selenic.com/bts/issue3233



More information about the Mercurial mailing list