R – Bazaar offline + branches


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!

Best Solution

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.

Related Question