tags:

views:

150

answers:

1

I have a Bazaar repository on Host A with multiple branches. This is my main repository.

Until now, I have been doing checkouts on my other machines and committing directly to the main repository. However, now I am consolidating all my work to my laptop and multiple VMs. I need to be working offline regularly. In particular, I need to create/delete/merge branches all while offline.

I was thinking of continuing to have the master on Host A with a clone of the repository on the laptop with each vms doing checkouts of the clone.

Then, when I go offline, I could do bzr unbind on the clone and bzr bind when I am back online.

This failed as soon as I tried to bzr clone since bzr clone only clones a branch(!!!!)

I need some serious help. If Hg would handle this better please let me know (I need Windows support.) However, at this moment I cannot switch from Bazaar as it is too close to some important deadlines.

Thanks in advance!

A: 

bzr fundamentally works with one branch / directory (the branch are visible at the file system level), so if you need to clone each branch from your repository (not unlike svn, in a way). Hg, at basic level, works this way too (although you can put several branches in one repository using say named branches).

For DVCS, it is important to distinguish between the following:

  • Working tree: a versioned set of files (at a given revision)
  • Branch: a linear set of revisions
  • Repository: a set of revisions

When you clone locally a directory versioned by bzr, you are copying the repository subset which contains all the revisions in the branch you are cloning, and get the working tree. This assumes you are not asking for a branch wo a working tree nor using a shared repository.

What you want, IIUC, is to clone the full repository with all the branches. There is no 'native' way to do so in bzr I believe, but plugins to help you toward this, like multi-pull and push-repo, to sync multiple branches in one shot.

But I don't understand why that's such a big problem, or the link with working offline: you just clone the branches you want to work on your laptop.

David Cournapeau
I see. So the fundamental issue is that I should have created a trunk/branches structure like in SVN? That makes so much sense if so.
cheez
Hmm, no that's not what you are saying.
cheez
God, no, the whole point of DVCS is to go away from the broken SVN model for branches and tags :)But when you clone with bzr (and hg), you are copying a subset of all the revisions, the ones attached to the branch you are cloning. Generally, you do NOT want to get every branch (I think that this is linked to a fear of losing some revisions and influence of CVS/SVN).
David Cournapeau
Actually, even with git where the model is all the branches in a single repository, when you clone a repository, you get only one branch, at least by default. Getting every branch of a repository is very unnatural for development IMHO.
David Cournapeau
David, your comment heads into wrong direction. Checkouts in bzr works almost like checkouts in svn/cvs. And topic starter wants to have checkouts behavior.
bialix
David, the point is that I want/need to do branched development offline and sync up when I get back online. How can I do that with a DVCS? It seems that is not allowed?
cheez
nothing is disallowed, but some things are easier than others. multi-push/multi-pull does not do what you want ?
David Cournapeau
Oh, that is really too bad. Thanks!
cheez