tags:

views:

471

answers:

2

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?

+1  A: 

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
James Polley
Oh, much simpler. So bzr init-repo is not necessary at all when creating a shared repository?
neoneye
Which is basically what you suggested first, but without the init-repo step. That's not necessary at all, and so I wouldn't bother with it. init-repo is used when you want to create a shared repository to track lots of related branches of the same project - what you have here are three unrelated projects.
James Polley
http://wiki.bazaar.canonical.com/Tutorials/CentralizedWorkflow talks about one of the cases where you might want to use init-repo, http://wiki.bazaar.canonical.com/Tutorials/CentralizedWorkflow another (although both are similar cases). In your case, init-repo is completely superfluous.
James Polley
Ok thank you, that makes sense. The "Centralized Workflow Tutorial" was what confused me http://doc.bazaar.canonical.com/bzr.2.0/en/tutorials/centralized_workflow.html
neoneye
+4  A: 

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.

bialix
I care about things that works and is simple. Speed and size is not important. Thank you :-)
neoneye