making checkouts, branches and repositories on disk - and the whole naming debate

Robert Collins robertc at robertcollins.net
Tue Jan 24 07:24:07 GMT 2006


So there was a recent thread I now cannot find about the terms we use
for checkouts, for checkouts + branches + repositories in one place, for
branches in repositories (which then cannot have checkouts) etc.

We have an impending API clarity problem: we need to create each of
these permutations from time to time, and while the primitives to create
each separately will obviously have to exist, it would be nice to have
shortcuts.

The problem is where these should go? In branch-formats, for example,
I've created WorkingTree.create_standalone which creates a standalone
working tree and branch. - its a neither fish nor fowl issue.

We have at least the following variations to create:
working tree no branch
working tree, branch, repository
branch and repository
branch in a repository
repository

What these all have in common is that they are creating persistent
structures on disk/at urls. So my thought is that if we have a factory
object somewhere (I have no name for it yet), we can have methods like:

create_checkout
create_standalone_branch
create_treeless_branch
create_branch_in_repository
create_repository


Theres a symmetrical problem - the open and open_containing methods.
Sometimes we know what we want - 'commit' for instance must have a
working tree. Sometimes we dont though: status and diff can operate with
no working tree via the -r parameters. So we have some open_containing
requests (presumably we have an open variation if desired):
* give me the containing tree (or an error if a branch or repository is
found before a tree) [commit]
* give me the containing tree/branch/repository [cat-file]
* give me the containing branch/repository (or an error if a tree
without branch/repo is found first) [bind]
* give me the containing repository (or an error if a tree or branch is
found first) [make-branch-in-repository]

So I'm picturing one object with suitable methods on it to provide all
of this, which might be a singleton, or they might be class methods. 

Thoughts?
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/20060124/b796f478/attachment.pgp 


More information about the bazaar mailing list