Bazaar experimental branch removal (repost)

Ian Clatworthy ian.clatworthy at internode.on.net
Fri May 16 09:26:19 BST 2008


Guido Ostkamp wrote:
> Hello,
> 
> a while ago I posted the questions listed below but unfortunately I got
> no replies at that time, thus I repeat it one last time.
> 
> If you can give some hints, your answers will be appreciated.

Apologies. I've been meaning to reply but other things have taken
priority this week ...

> ***
> 
> Hello,
> 
> I've been reading through the Bazaar user guide (I'm new to Bazaar, but
> a bit familiar with Git and Mercurial).
> 
> It appears the "Mirror branch" concept described in chapter 6.2 in the
> user's guide will serve me best because I can save disk space if I use a
> top-level repository with a nested main mirror branch like with
> 
>   $ bzr init-repo X-repo
>   $ cd X-repo
>   $ bzr branch sftp://centralhost/srv/bzr/X-repo/X-trunk
>   $ bzr branch X-trunk X-crazy-idea
>   $ cd X-crazy-idea
>     (hack, hack, hack)
> 
> Unfortunately I could not find info how I can get totally rid off such
> an 'crazy-idea' branch and recover all the disk space required for any
> of its commits, when it becomes clear that the stuff will not be used
> any longer.

Revisions are stored very efficiently so it's not a practical issue for
most people. Your case could be different though - you seem to be
versioning some very large (binary?) files, yes?

Keep in mind as well that Bazaar doesn't ship around whole repos (like
Git does) - it ships around just the branches you ask it too. If you
never push/pull that crazy-idea branch elsewhere, it's revisions won't
take up space in anyone's repo except yours.

> With 'git' I could easily use 'git branch -D X-crazy-idea' and after a
> repack the space formerly used for the branch would be reclaimed.
> 
> How can I do this with Bazaar?
> 
> It's clear to me that if I wouldn't use top-level repositories with
> nested branches, but two independent branches instead like
> 
>   $ cd /somewhere
>   $ bzr branch sftp://centralhost/srv/bzr/X-repo/X-trunk
>   $ bzr branch X-trunk X-crazy-idea
> 
> I could remove the 'X-crazy-idea' directory alltogether, but then I
> cannot save the space as 'X-crazy-idea' will need the same full copy of
> the project history as X-trunk, as long as it exists.

That's right. FWIW, Robert Collins is working on "stacked branches" that
*might*  be just what you want. If not, it will be the basis of "shallow
branches" that might be as well. :-)

Ian C.



More information about the bazaar mailing list