Integrating two [unrelated] branches via fast-import

Ian Clatworthy ian.clatworthy at
Tue Oct 27 03:19:18 GMT 2009

John Arbash Meinel wrote:
> Alexander Belchenko wrote:
>> Hi Ian,
>> I need your advice for my something strange task.
>> I have 2 repositories of FTE project: one repo is official CVS one, second repo is forked SVN repo.
>> SVN repo is not converted from CVS, but just started from some CVS revision. I want to join both
>> repos as common history in bzr shared repo.
>> I have successfully converted CVS repo with cvs2bzr, and converted SVN repo with svn-import (from
>> bzr-svn). Now I have 2 unrelated history: converted CVS and converted SVN.
>> I want to try join them manually via fastimport dump. Do you think it is possible?
>> E.g. I will dump first and second to fastimport stream, and then manually add links between both.
>> I'm not expert in fastimport format yet, so before I'll start to dig so deep I'd like to get some
>> advice from you, because you're master of bzr fast-import.
>> Is it possible and where I should start?
>> Thanks,
>> Alexander
> If one is going to just be an ancestor of the other one, I think you
> just have to add the "parent" link. However, I think the export process
> is probably going to use "marks" to shorten the sha hashes. (:1 ==
> ab342ba3b34bc3, etc.)
> As such, you'll probably have to re-number all of child marks, so that
> they don't conflict with the marks in the parent stream.
> After, that, it should just be 'cat >'.

That sounds the right approach. It would be nice to make this a
documented process and work out what's required to make it smoother. I
can imagine quite a few projects in a similar position.

At a minimum, bzr fast-export probably needs an option added saying
"start using marks from X onwards", instead of assuming the first mark
is always 1. You'll also need to manually edit to tell it the
commit mark to base the first one in that file on. Maybe that should be
a fast-export option too?

Ian C.

More information about the bazaar mailing list