[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bzr repository ready?

From: Jason Earl
Subject: Re: bzr repository ready?
Date: Sun, 22 Nov 2009 13:32:50 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Jason Earl <address@hidden>
>> Cc: Eli Zaretskii <address@hidden>,  =?utf-8?Q?=C3=93scar?= Fuentes
>>  <address@hidden>,  address@hidden
>> Date: Sat, 21 Nov 2009 22:13:57 -0700
>> "Stephen J. Turnbull" <address@hidden> writes:
>> > But Bazaar branches *cannot* at present be colocated; they *cannot*
>> > share a working tree.  That means that if you do a "bzr branch" for a
>> > one-line change, you have to do a "make bootstrap" to test.
>> > EEEEEEeeeeeewwwwww.
>> That's not entirely true.  I keep a "workspace" checkout in my
>> repository and then "bzr switch" between the branches that I am
>> working on.  It probably doesn't work exactly like git, but it
>> certainly allows you to switch between branches without doing a make
>> bootstrap.  Commits go to the right place, the branch nick gets set
>> correctly, switching is fast, and make does the right thing.
> But that means you already bootstrapped each branch at least once,
> right?  Or did I misunderstand the functionality of "bzr switch"
> and/or how you use it?

No, you can simply bootstrap the "workspace" checkout.  In fact, I
usually create the rest of the branches either with the --no-tree option
or in a repository initialized with --no-trees.  So the workspace
checkout is the only directory that even has any sources.

So for example, you simply create a repository like so:

bzr init-repo --no-trees emacs

Then cd into the repository and create a mirror branch of mainline like

cd emacs
cvs branch http://bzr.savannah.gnu.org/r/emacs/trunk/ trunk

This will create a directory that is a branch, but the branch will not
have any files in it.

Now let's imagine that you want to do some actual hacking in a branch
that you call dev.  You would create the branch like so:

bzr branch trunk dev

Finally you create a workspace directory.  This is the only directory
that actually has any sources in it.

bzr co --lightweight dev workspace

>From within the workspace directory you can change branches with the
switch command.  For example in the root of the workspace directory you
would type:

bzr switch ../trunk

to switch to the trunk.

This setup allows you to switch between as many branches as you might
care to make without having to do a make bootstrap in each, and indeed
without having to waste space on duplicate (or nearly duplicate) copies
of the source.

Of course, if you prefer, you can also use bzr almost precisely as you
use CVS today.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]