RFC: The "xml8" patch
Martin Pool
mbp at canonical.com
Mon Nov 30 08:31:21 GMT 2009
2009/11/30 Gordon Tyler <gordon at doxxx.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> John Arbash Meinel wrote:
>> The main reason it hasn't been included is because it isn't strictly
>> safe as is. Namely at least the test suite likes to take an Inventory
>> and then mutate attributes of its entries directly. (And mutating an
>> item that is in a cache is a bad thing.)
>
> I guess my question would be: Is it acceptable (i.e. part of its
> contract) that a client mutate an Inventory's entries' attributes
> directly? Just because a test case does it, doesn't necessarily mean
> that it's right.
Now, no. It used to be, but I think this was not a good design
because it inherently does O(tree) copying just in case someone
mutates it, and normally we want code to be talking about tree deltas.
So the risk as I understand it is that there could be non-test code
that also does this and it could introduce nasty bugs.
Making the objects guard against mutation would be possible but I
would guess too slow.
There's another option which is just to update or delete all the
relevant tests. I don't know if they're helping us much at this
point, since they're testing a conceptually deprecated interface.
--
Martin <http://launchpad.net/~mbp/>
More information about the bazaar
mailing list