versioning Linux config files on two servers with cross-mounted /home folder
Eric Siegerman
lists08-bzr at davor.org
Fri Mar 28 10:30:42 GMT 2008
On Wed, 2008-03-26 at 12:10 -0500, Rahul Nabar wrote:
> I meant "how does it decide the location of the default repo"
> (I thought the bzr init specified that on serverA but was afraid that
> the new serverB would be lost! Apparently not! Good!)
There is no "default repo", in the sense that CVS defaults to using the
repository that's named by the CVSROOT environment variable. In bzr,
it's all to do with file-system hierarchy.
That is, bzr searches up the tree (.., ../.., ../../.., etc.) until it
finds a directory containing a ".bzr" subdirectory. Whichever directory
that is, is the root of the branch (or checkout -- it uses the
contents of .bzr to determine which).
All "bzr init foo" does is to create foo/.bzr, with appropriate
contents. The same goes for shared repositories: "bzr init-repo bar"
just creates bar/.bzr, with appropriate contents. In neither case
does bzr stash away some magic pointer in some external location, to be
used later to find the directory again.
When you create a branch using "bzr init foo", bzr has to decide where
the foo's revision history will be stored. Again, it searches up the
tree. If it finds some ancestor directory "bar" whose .bzr says it's
a shared repo, bzr arranges for foo's revision history to be stored
under bar/.bzr. If it gets to / without finding a shared repo, it
arranges for foo's revision history to live in foo/.bzr itself -- a
standalone branch. Bzr doesn't, CVS-style, go off to some other
shared-repo which is not an ancestor of foo, but whose location was
previously stashed away.
So that's why you don't have to "bzr init" anything on serverB. All
that's needed is for all the relevant .bzr directories to live on the
cross-mounted file system.
- Eric
More information about the bazaar
mailing list