Abstract methods in Branch
John A Meinel
john at arbash-meinel.com
Sun Oct 30 18:04:43 GMT 2005
Jelmer Vernooij wrote:
> Hi,
>
> Since I would like to derive more classes from Branch then just
> bzr's current _Branch for foreign branch support, I have worked on
> making the distinction between Branch and _Branch a bit clearer:
>
> * Rename _Branch to NativeBranch to more clearly indicate what it does
> * Move some generic methods to Branch
> * Add dummy methods that simply raise NotImplementedError for
> all abstract methods in Branch
>
> These changes are in the branch at
> http://jelmer.vernstok.nl/bzr/foreignbranch
>
> (based on Robert's integration branch)
>
> Please comment and/or merge :-)
First, before I get into it, I really like the idea of refactoring all
of this. There are quite a few possibilities for changing the Branch
object to support all sorts of branch types. Thanks for doing the work.
I think quite a few of these functions are supposed to be a part of
WorkingTree and not a part of Branch itself.
Robert probably has a better idea of where he wants the line drawn, but
something like "unknowns()" is definitely a property of the working
tree, and not the branch. (There are no unknowns in a branch).
I would say that something like "get_inventory_weave()" should probably
be an implementation detail, not required of all branches.
I'm guessing that get_revision_xml and get_revision_xml_file() would
also be considered implementation details.
Especially if you are considering foreign branches, not all of them
would represent their revisions as XML. I would guess that most of them
would only implement the get_revision() interface.
Does anything use "get_revision_delta"?
"get_revision_inventory()" is an artifact of the day when inventories
had theoretically different ids than revisions (though in practice they
have always been the same). I would get rid of it.
I'm not sure if Branch is supposed to have a commit() function. Or
whether we expect people to go through the bzrlib.commit.* interfaces.
I think it is still there for convenience in the test suite.
But then again, if you are planning on committing changes into foreign
branches, then maybe we need to move it back into Branch.
Those are my comments at least,
John
=:->
>
> Cheers,
>
> Jelmer
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051030/0d921515/attachment.pgp
More information about the bazaar
mailing list