making checkouts, branches and repositories on disk - and the whole naming debate
John Arbash Meinel
john at arbash-meinel.com
Tue Jan 24 21:31:52 GMT 2006
Robert Collins wrote:
> On Tue, 2006-01-24 at 14:57 -0600, John Arbash Meinel wrote:
>
>>Robert Collins wrote:
>
>
>>Right now we handle this by using WorkingTree.open_containing versus
>>Branch.open_containing. We use the former if we know that we need a
>>working tree, and the latter if we just need branch information.
>>However, we end up with code duplication (the open containing loop).
>
>
> And if we need 'the first thing found' - we currently search for a
> branch and then open the tree at the branch if desired. This is ok today
> while branches always co-exist but it wont be very very soon.
>
Well, if we have a checkout, 'the first thing found' should find that,
and then return the associated branch.
>
>>I wouldn't mind seeing something that just understood
>>'.bzr/branch-format' (and the future '.bzr/meta-format'). And this could
>>then be called by all other functions.
>
>
> MetaTree.open_containing ?
>
> that will work too, but I suspect we will have a bunch of duplicate code
> building on this.
>
> Rob
>
Well, WorkingTree.open_containing just tries to do return
WorkingTree(path) once it finds something.
So a future version would be:
class WorkingTree(...):
def open_containing(path):
base_path, tail = MetaTree.open_containing(path)
return WorkingTree(base_path), tail
That isn't a lot of duplicate code.
But really we want something which parses all of the branch format stuff
and returns at least version objects, if not the final branch itself.
I'm not sure how you are doing it in your branch-format stuff.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060124/56b08a01/attachment.pgp
More information about the bazaar
mailing list