combining 2 projects under one repository

Jelmer Vernooij jelmer at samba.org
Thu Nov 3 19:17:06 UTC 2011


On 11/03/2011 08:09 PM, Colin D Bennett wrote:
> On Thu, 3 Nov 2011 11:36:33 +1100
> Martin Pool<mbp at canonical.com>  wrote:
>
>> On 3 November 2011 10:40, Matt Funk<matze999 at gmail.com>  wrote:
>>> Hi,
>>> right now i have 2 repositories that do not share code but are
>>> related in terms their fcn. Both are under bazaar. I would like
>>> to combine those 2 under one repository. I guess i could create
>>> a new repository but i would like to avoid that.
>>> Is there some sort of tool that does this easily?
>>> thanks for any advice
>> It depends a bit what you mean by 'in one repository' but I'm
>> guessing you mean you want just one tree with all the code in
>> it.  One easy way to accomplish that is 'bzr merge
>> -r0.. ../OTHER_TREE'.
> This “cherrypick” merge will completely discard the history of the
> imported project, right?
No, this isn't a cherrypick merge since -r0.. isn't open-ended on the 
left side. Using e.g. -r2.. would be a cherrypick merge.
> Is there any way to import that project's revisions?  I guess they
> can't be _exactly_ imported because the file paths will be different
> than in the original, but at least the content, timestamp (?), log
> messages, renames, adds, removes, etc. could be tracked if these
> changes were really imported in a complete way.
>
> I recall hearing about “bzr join”, but after reading the
> documentation on it, I am thoroughly lost as to its utility in
> cases like Matt's (importing one branch into another unrelated
> branch).  I do not understand the concept of “rich-root” and
> “subtree”.
If you had a library named say "libbla" and wanted to import that into 
another project, you can use "bzr join" to merge it into a particular 
path in your main project. The difference with "bzr merge -r0.." is that 
merge will try to merge it into the root directory.

Cheers,

Jelmer



More information about the bazaar mailing list