[MERGE] check for duplicate file-ids in Inventory.apply_delta()
Ian Clatworthy
ian.clatworthy at internode.on.net
Mon Mar 9 06:03:08 GMT 2009
Speaking with Robert, we believe that Inventory.apply_delta() ought
to fall over if the same file-id appears multiple times within a delta.
In particular, deltas passed to CHKInventory.create_by_apply_delta()
create bad deltas to pass to the lower layer is this isn't true. We
therefore want consistency across the various APIs expecting a delta.
This patch checks the delta and adds some tests for apply_delta - none
existed previously as best I could find.
I've also grouped the Inventory tests into read vs update groups.
That should help when CHKInventory's land: the read tests ought to
(be refactored to) work on both Inventory & CHKInventory while the
update tests will only apply to Inventory given CHKInventories are
immutable.
Ian C.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apply-delta-checking.patch
Type: text/x-diff
Size: 9578 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090309/2c3a4799/attachment.bin
More information about the bazaar
mailing list