Demonstration Help.

Colin D Bennett colin at gibibit.com
Fri Feb 20 18:49:13 GMT 2009


On Fri, 20 Feb 2009 10:14:06 -0800
Eric Berry <elberry at gmail.com> wrote:

> > Yes, when Bazaar creates the local branch copy of ProjectA/main,
> > ProjectB/main, etc., it will notice that the local target directory is
> > below a shared repository directory in the filesystem hierarchy, so it
> > will store all the actual revision data in the shared repo, making the
> > actual branch data very small (on the order of 100 KiB), plus the
> > working tree since you implicitly specified to create working trees as
> > well.
> 
> Cool. :) That's really nifty. In regards to the working tree, I was under
> the impression that if I had specified --no-trees, I would not be able to
> create working trees under the shared repo. Is that incorrect?

The --no-trees option just indicates that branches are initially
created without working trees.  You can still create working trees by
running 'bzr co' in a branch within the repository.  This will "check
out" the branch which, in this case, basically just creates a working
tree:

   cdb at gamma ~/bzr $ bzr init-repo --no-trees .
   Shared repository (format: pack-0.92)
   Location:
     shared repository: .
   cdb at gamma ~/bzr $ bzr branch ~/.bazaar/plugins/automv
   Branched 1 revision(s).
   cdb at gamma ~/bzr $ cd automv
   cdb at gamma ~/bzr/automv $ ls
   cdb at gamma ~/bzr/automv $ bzr co
   cdb at gamma ~/bzr/automv $ ls
   __init__.py  test_automv.py
   cdb at gamma ~/bzr/automv $ bzr reconfigure --branch
   cdb at gamma ~/bzr/automv $ ls
   cdb at gamma ~/bzr/automv $
   cdb at gamma ~/bzr/automv $ bzr reconfigure --checkout
   cdb at gamma ~/bzr/automv $ ls
   __init__.py  test_automv.py
   cdb at gamma ~/bzr/automv $

So you can use either 'bzr reconfigure --checkout' or 'bzr co' to
create a working tree, and you can use 'bzr reconfigure --branch' to
remove the working tree.  (Note that 'reconfigure --branch' will refuse
to delete modified files, so, happily, it is safe.)

Also, if you want to browse some files in a branch without a working
tree and you don't want to create a working tree, sometimes the
'bzr qbrowse' command from the QBzr plugin is useful.  It lets you
browse the files of a branch without requiring a working tree.

> So, I could have done:
> [code current_dir="~/development/projects"]
> bzr init-repo --no-trees .
> bzr branch ftp://[host]/ProjectA/main ProjectA
> bzr branch ftp://[host]/ProjectB/main ProjectB
> bzr branch ftp://[host]/ProjectC/main ProjectC
> [/code]
> 
> And spared myself the extra space of the working tree for each local branch?
> Would I still be able to see all the files, and work directly on each local
> branch? Or would I then have to branch, or checkout, somewhere else from
> those local branches?

You would spare yourself the space from the working trees.  You
wouldn't see the files directly in the filesystem, but you could then
use 'bzr co' or 'bzr reconfigure --checkout' to create a working tree
on demand in-place.  Alternately, something like 'bzr qbrowse' could be
used.

You could also use a lightweight checkout in a different directory, of
course, so it is your choice whether you want your working tree in the
repository branch directory or somewhere else.

Regards,
Colin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090220/c46401c3/attachment.pgp 


More information about the bazaar mailing list