Introduction
Foreign branches is a feature that was proposed by AaronBentley in BzrWishList:
- It would be really nice if you could branch from an SVN or other semi-sane system, do multiple commits, then submit your changes back to the mainline using the 'submit' command. Doing this with CVS would probably be an exercise in misery, but any SCM with atomic commits could be a target. We could ensure that all imports of the same source produced the same data, so that parallel imports could merge from each other.
I think ForeignBranches have killer ease of use. The qualitative difference between working on an imported branch and just bzr branching it is huge.
Implementations
It is certainly doable to add support for other systems not listed here as well, if they have atomic commits and some mechanism to create unique identifiers for revisions.
Subversion
There is an implementation of a plugin that adds support for foreign Subversion branches. Committing to Subversion branches is also supported. Includes SVK support.
Mercurial
There is a read-only implementation of support for foreign Mercurial branches.
Git
There is a read-only implementation of support for foreign Git branches.
Darcs
There is no support for foreign Darcs branches yet, though this should be very well doable. There needs to be some care because of what Darcs considers to be idempotent versus what Bazaar would consider the same. (Darcs treats a branch as a set of revisions, while Bazaar considers it a history of revisions. So in Darcs the histories (A, B, C, D) and (A, C, B, D) are considered equivalent, it just means Bazaar needs to be careful with what it considers ancestry for a Darcs branch).
Baz
There is no support for foreign Baz (Bazaar 1.0) branches at the moment, but BzrTools contains a baz-import command that can convert Baz repositories to Bazaar repositories.
CVS
There is no support for foreign CVS branches at the moment. Creating it may also prove hard as CVS lacks atomic commits or unique identifiers to identify branches.
However, there are options for converting from CVS without foreign branches:
Launchpad
https://launchpad.net offers a CVS repository tracking service. This is great for tracking a branch that is in CVS.
CVSPS
On the http://bazaar-vcs.org/BzrPlugins there is a cvsps plugin from JohnMeinel which allows single-shot conversion of CVS repositories to bzr. This should be used for migration.
Monotone
There is no support for foreign Monotone branches yet, but it should in theory be possible.
