Revisit Newbie Bazaar Repository and Branch Setup

Neil Martinsen-Burrell nmb at wartburg.edu
Wed Dec 8 16:34:18 GMT 2010


On 2010-12-08 10:16, Tom Browder wrote:
> The first blush is off the bazzar rose for me now, and I have been
> happily using bazaar as I first set it up.  Now I wonder if I didn't
> do something wrong and would appreciate some advice.
>
> My goals were to:
>
> 1. replace subversion, partially, so I could operate better
> disconnected from the company subversion repository
>
> 2. replace subversion entirely for my private software and documents
>
> 3. operate primarily on my laptop with checkouts of all source from a
> single, shared repository on my home server
>
> 4. operate disconnected while away from home, rebind when at home
>
> I created the shared bzr repo on my server (call it the central repo),
> checked out the several company svn repos into the central repo, and
> checked all my private projects also into the same central repo.  Then
> I did "bzr unbind" for all the checkouts on the server.
>
> I then created a shared repository on my laptop into which i checked
> out all the projects of interest from the central bzr repo on my
> server.
>
> Those goals are working for normal operations: I have worked away from
> home and returned and rebound to the central repo fine,and I have
> periodically rebound to the company repositiry and committed all my
> changes.  But when my laptop went unusable for a while, I was forced
> to work on the server and had problems trying to work in a project's
> working tree in the central repository--I couldn't get the files up to
> the latest revision which had been committed from the laptop.
>
> Now I believe I made at least two bad choices:
>
> 1. I should not have created shared repositories because each project
> is a separate object with essentially no dependency on another.

This ought to be irrelevant.  Some Bazaar developers use shared 
repositories that contain branches for all of their projects.  Someone 
even once suggested ``bzr init-repo ~``.  That said, there may failure 
modes that can affect a repository and if that happens in a shared 
repository, then it could impact all of the projects stored there.

> 2. I created the shared repos on the server with trees with and tried
> to work in the repo projects which doesn't seem to work.  In order to
> work on the server on occasion, such as when I have a laptop problem,
> I believe I should do a checkout in a location outside the central
> repository.

"doesn't seem to work" is vague.  Can you give more details about what 
happened?  It is likely that all that was needed a ``bzr update`` in the 
branch that had been pushed *to* from the laptop.  That said, on my own 
"central server", I prefer to have checkouts of my branches  which are 
stored in a "no-trees" shared repository in a different directory.

> 1.  The shared repos have a ".bz" subdirectory at the top level as
> well as one in each project.  Can that top-level subdirectory be
> removed in order to removed the "shared repository" status?

No.  The actual revisions of the branches that are in directories under 
the shared repository (the branches also have .bzr directories at their 
roots) store their revisions inside the top-level .bzr directory.  In 
order to remove the branches' dependence on the shared repository, use 
the command ``bzr reconfigure --standalone`` inside of each one.  To 
check that you have been successful, ``bzr info`` in each branch should 
have no mention of "shared repository" or "Repository tree".

> 2.  If it is possible to use the project repos on the server as
> working directories, how do I do that?  If I can do that, should I do
> that, i.e., is that not a good practice?

Yes, you can do that.  As I said above, I find it easier to work in 
checkouts of the branches when I am working directly on the "central 
server", but I don't have a particularly good argument for doing so. 
(My only sense is that is maintains a separation between the "official" 
version of a branch and any of my working copies.  Thus it keeps all of 
the working copies as peers, no matter which computer they are on.) 
Perhaps someone else here can express a clearer reason.

-Neil



More information about the bazaar mailing list