[MERGE/RFC] MemoryTree and a TreeBuilder helper

Robert Collins robertc at robertcollins.net
Thu Sep 7 23:40:15 BST 2006


On Thu, 2006-09-07 at 17:04 -0500, John Arbash Meinel wrote:
> Robert Collins wrote:
> > On Thu, 2006-09-07 at 15:32 -0500, John Arbash Meinel wrote:
> >> ...
> >>
> >> v- Because we aren't testing it as an API, shouldn't it be private
> >> _MutableTree, which is just an implementation detail?
> > 
> > Its a base class for WorkingTree, I think its distateful to have a base
> > class of a public facility be private. Also, I can add interface tests
> > for it if you feel thats better - I was on the fence : on the one side
> > I'm testing the specific behaviours on wt and on memorytree which could
> > be consolidated. On the other hand, theres still quite some setup to
> > make interface tests.
> 
> I agree it is distasteful to have a public object use a private one as
> the base.
> 
> My concern was just that you now have an API which isn't directly
> tested, which has to be preserved across versions because of our strict
> deprecation rules. And since it isn't directly tested, it is very easy
> to mess up, and violate an old invariant that you didn't know was there.
> 
> (The pypy guys have an interesting "solution", in that their api is only
> defined by the test suite.

So we have three choices:
 * Take the current patch
 * Make MutableTree private
 * Add interface tests.

I think the current patch is fine - because MutableTree is not a
concrete implementation - its not directly usable, only WorkingTree and
MemoryTree, or external subclasses are directly usable.

If the current patch isn't fine, my preference is adding interface tests
for MutableTree, which would exercise WorkingTreeFormat* and MemoryTree.
..
> file=>symlink is a little bit more straightforward. But it seems like
> making a file change to a directory automatically because the path is
> the same is more likely to be wrong than it is to be right.

Possibly we want a '--force-kind-change' option to the UI ?

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: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060908/ddfbcee6/attachment.pgp 


More information about the bazaar mailing list