joining trees ?

Asked by Se6

Hi,

I am using bzr on a simple project of mine.
So let's say I have a ~/myproj/projA dir where I did a bzr init, and then I versioned what was underneath.
Now I would like to start a related project, ~/myproj/projB, but I don't want to have an new repository in it, instead, I would like to have a new repository in ~/myproj which will contain projA (and all its history) and projB.
So, in ~/myproj I did
bzr init
bzr add projB
bzr join projA
But then I get an error:
bzr: ERROR: Can't join trees because KnitPackRepository('file:...myproj/.bzr/repository/') doesn't support rich root data.

What am I doing wrongly ?

Thanks,

Seb.

Question information

Language:
English Edit question
Status:
Expired
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vincent Ladeuil (vila) said :
#1

It seems you want a shared repository, not joining trees.

So you should do (starting from scratch):
bzr init-repo ~/myproj
bzr init ~/myproj/projA
bzr init ~/myproj/projB

This way projA and projB will use the repository in ~/myproj to store their revisions, projA and projB containing only the branch themselves which will use ~/myproj repository.

Since you already defined a branch with its own repository (when you did bzr init ~/myproj/projA), what happened when you did bzr init in ~/myproj is that bzr created a stand alone branch at ~/myproj.

So I think you should do:
mv ~/myproj to ~/myproj.old
bzr init-repo ~/myproj
bzr branch ~/myproj.old/projA ~/myproj/projA

For projB you may want to start again by:
bzr init ~/myproj/projB
to get a clean start, put your files under ~/myproj/projB and bzr add, bzr commit there.

bzr join is used when you want to import, say, a library already under bzr into your project, not what you seem to search for here.

Revision history for this message
Se6 (se6astien) said :
#2

Hi Vila,

Thanks very much for your answer.
Doing what you suggested, I will get a single repository with two independant branches in it (projA and porjB), right?

In fact I was not clear in my wording. After having worked for a while with myproj/projA, I realised that projA should not be an independant project, but was in fact part of a bigger project myproj. So I would like kind of move the repository below (to myproj) and add more to the project (projB, etc..) and I do not want to have projA independant from projB... That is why I was looking at join.

Seb.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Se6 (se6astien) said :
#4

Nobody can help me on that one?
Thanks in advance!
Seb.

Revision history for this message
Dan Watkins (oddbloke) said :
#5

You might want to do 'bzr upgrade --1.6.1-rich-root' (or 'bzr upgrade --rich-root-pack', depending on the version you're using) and try again.

Dan

Revision history for this message
Se6 (se6astien) said :
#6

Thanks Dan.

However after doing that, I now get the error:

bzr: ERROR: Cannot join projA. Trees have the same root

Seb.

Revision history for this message
Martin Pool (mbp) said :
#7

Seb,

Is it enough to just simply merge the trees together, ie 'cd projA; bzr merge ../projB'?

Revision history for this message
Se6 (se6astien) said :
#8

Thanks Martin for your sugggestion.
No, merging is not what I am looking for here.

Seb.

Revision history for this message
Wouter van Heyst (larstiq) said :
#9

On Wed, Oct 22, 2008 at 11:59:56PM -0000, Martin Pool wrote:
> Question #46922 on Bazaar changed:
> https://answers.edge.launchpad.net/bzr/+question/46922
>
> Status: Open => Answered
>
> Martin Pool proposed the following answer:
> Seb,
>
> Is it enough to just simply merge the trees together, ie 'cd projA; bzr
> merge ../projB'?

If they are inited seperately that would have to be 'bzr merge -r 0..-1
../projB'

Wouter van Heyst

Revision history for this message
Jay R. Wren (evarlast) said :
#10

I am able to join properly on brand new branches.

e.g. this works:

jrwren@theknife /c/temp
$ bzr init -v --1.9-rich-root A
Created a standalone tree (format: 1.9-rich-root)

jrwren@theknife /c/temp
$ cd A

jrwren@theknife /c/temp/A
$ bzr init -v --1.9-rich-root B
Created a standalone tree (format: 1.9-rich-root)

jrwren@theknife /c/temp/A
$ bzr join B
renamed file:///C:/temp/A/B/.bzr to .bzr.retired.0

jrwren@theknife /c/temp/A
$

But if I do the same thing on two existing branches, both of which were upgraded to 1.9 rich root, I get the same error as Seb.

bzr: ERROR: Cannot join myproject2/. Trees have the same root

Seb, this was many months ago, did you ever find a solution?

Revision history for this message
Se6 (se6astien) said :
#11

>Seb, this was many months ago, did you ever find a solution?
No unfortunately!

Seb.

Revision history for this message
Martin Pool (mbp) said :
#12

If you don't want them to be independent but you don't want them to be merged it's not clear to me what you do want to have happen.

Maybe you should look at <http://bazaar-vcs.org/ScmProj>

Revision history for this message
Launchpad Janitor (janitor) said :
#13

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.