Abstract methods in Branch
Jelmer Vernooij
jelmer at samba.org
Sun Oct 30 18:41:28 GMT 2005
On Sun, Oct 30, 2005 at 12:04:43PM -0600, John A Meinel wrote about 'Re: Abstract methods in Branch':
> 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).
Since you and Robert were already working on removing methods
that belonged in WorkingTree rather then Branch I decided to not touch
that.
> I would say that something like "get_inventory_weave()" should probably
> be an implementation detail, not required of all branches.
Agreed. I've renamed it to _get_inventory_weave() now and made it
NativeBranch-specific.
> 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.
The problem is that those functions are currently assumed to be
present by other parts of the code (such as bzrlib.fetch), hence why I
added them as abstract methods anyway. In the future we could either
remove the calls to those methods or implement them as dummy methods that
generate XML from get_revision()'s return value.
> Does anything use "get_revision_delta"?
Yes, it's used, among other things, by the log command. I've moved it
into Branch now though as it shouldn't be different for different
branch types.
> "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.
Ok.
> 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.
I'd rather not rule that out beforehand.
Thanks for your comments.
I've updated the branch at http://jelmer.vernstok.nl/bzr/foreignbranch
Cheers,
Jelmer
--
Jelmer Vernooij <jelmer at samba.org> - http://jelmer.vernstok.nl/
19:22:09 up 9 days, 8:27, 4 users, load average: 0.47, 0.44, 0.36
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051030/a186913d/attachment.pgp
More information about the bazaar
mailing list