[MERGE] check for duplicate file-ids in Inventory.apply_delta()
John Arbash Meinel
john at arbash-meinel.com
Mon Mar 9 06:51:28 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ian Clatworthy wrote:
> 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.
>
BB:tweak
The only thing I would recommend is deleting the 'seen' set after you
check the stream.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkm0vHAACgkQJdeBCYSNAAPn3ACePxXz4nhSQCB4iYYXePQB6yvj
RrMAoLU7giq/whFce/HYQtB+NwgURVLr
=O9O3
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list