Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bzr init-repo and multiple projects

Tags:

dvcs

bazaar

I'm having difficulties understanding bzr init-repo.

I have 3 projects that I want to have in their own isolated repository, in subversion I would use svnadmin create three times to create them. Like this:

svnadmin create MyProject
svnadmin create MyHomepage
svnadmin create MyDocuments

The above would give 3 isolated subversion repositories.

How do you create 3 isolated shared bazaar repositories?

would you do it this way

bzr init-repo ./repo
bzr init ./repo/MyProject
bzr init ./repo/MyHomepage
bzr init ./repo/MyDocuments

Or would you do it this way

bzr init-repo ./MyProject
bzr init ./MyProject/trunk

bzr init-repo ./MyHomepage
bzr init ./MyHomepage/trunk

bzr init-repo ./MyDocuments
bzr init ./MyDocuments/trunk

Or is there another way?

like image 226
neoneye Avatar asked Dec 30 '09 13:12

neoneye


Video Answer


2 Answers

bzr init-repo creates shared repository which is used to store branches' historical data. So all branches inside one shared repo will actually share the storage. Therefore you will need less space for history data of every branch, and faster branching.

If you don't care about space efficiency and speed of new branch creation then don't use shared repositories.

So if you want to have several branches for every of your projects (MyProject, MyHomepage, MyDocuments) the right way is:

bzr init-repo ./MyProject
bzr init ./MyProject/trunk

bzr init-repo ./MyHomepage
bzr init ./MyHomepage/trunk

bzr init-repo ./MyDocuments
bzr init ./MyDocuments/trunk

If you plan to have only one branch for every of your project then don't use shared repo at all, and do as James Polley suggested.

You even can create shared repo later and put your current branch into it with bzr reconfigure --use-shared.

like image 140
bialix Avatar answered Sep 29 '22 23:09

bialix


I wouldn't use init-repo at all, as they're not intended to be branches of the same code but independent projects.

I'd just do:

bzr init ./MyProject
bzr init ./MyHomepage
bzr init ./MyDocuments
like image 35
James Polley Avatar answered Sep 30 '22 01:09

James Polley