repositories - pinning down discovery behaviour

Robert Collins robertc at robertcollins.net
Sun Feb 5 22:31:57 GMT 2006


I've now got the infrastructure in place - bzrdir is essentially done,
but I want to check it has the requisite flexability.

On IRC Aaron and I agree that the following as an api makes sense:

a_bzrdir.open_repository() -> low level opens the present repository
object or raises NoRespository
a_bzrdir.open_branch().repository -> the repository that is in use by
the branch present here (which accomdates pointers-tobranches).


This has the corollary that most client code will use the latter idiom
to get a repository, and the former will be used by branch when opening
its repository, and by archive management code.


A related issue is the permutations we want to support. Recapping my
understanding.. using 'W', 'B', and 'R' to indicate the presence of a
working tree, branch and repository.

If we make a repository at ~:
~/.bzr/R

If we want to version control ~:
~/.bzr/WBR

A repository at ~ with a branch using that under it and acting like a
regular branch:
~/.bzr/R
~/source/foo/.bzr/WB


Do we support nested-branches-in-a-repository:
repo/.bzr/R
repo/foo/.bzr/B
repo/foo/libbar/.bzr/B

?
We've already said that nested trees should not automatically use their
parents storage area for regular trees, and I think the same default
should apply here, which suggests a need to give a UI for this.

The detection of 'containing .bzr dir is a repository' has been defined
as 'a repository with no W or B directories'... but it seems to me that
having ~ be versioned, and be a repository is a legitimate [but weird]
use case. IIRC it was Aaron that proposed a flag in the repository on
IRC, that should mark is as a repository rather than just a random dir.
This would allow an anonymous branch in repositories if we also allow
nested branches in repositories.

So, I have reversed my position there - I'm seeking a +1 on:
'support nested branches using a single repository' and
'shared repositories will have a marker of some sort'


This makes the search for a repository:
for each .bzr dir containing self.bzrdir:
  if there is a repository and its not marked as shared, stop
  if there is no repository, continue



Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060206/724d31d2/attachment.pgp 


More information about the bazaar mailing list