[MERGE][bug #300177] Pass compression_parent as part of 'get_record_stream'
John Arbash Meinel
john at arbash-meinel.com
Mon Feb 9 20:37:30 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> Robert Collins has voted comment.
> Status is now: Semi-approved
> Comment:
> I'd be a lot happier with this if the compression_parent field was only
> on KnitContentFactory, which is the only content factory for which it
> makes sense.
I would have thought that having "compression_parent = None" would be
sufficient.
The issue is that insert_record_stream() already assumes it needs to
know about a compression parent (if type in deltas).
The main changes are:
use record.compression_parents to determine if this is a delta record,
rather than building up a delta types set.
Allow "compression_parents" to be a list rather than a single entry, for
potential things like mpdiffs, etc.
Personally, I think doing:
if record.compression_parents:
# a delta
is better than
delta_types = set(['x', 'y', 'z'])
if record.storage_kind in delta_types:
# a delta
Because the latter needs more maintenance than the former.
I'm happy to change it as long as we have a nice way to check that
something *is* a delta, such that we want to make sure to unpack it to a
fulltext if we are in a stacked repository.
I could add a new "ContentFactory.is_safe_in_stacked()" or something
like that.... doesn't sound better than what I've done, though.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmQlAoACgkQJdeBCYSNAAMLOQCfSL6W5OpsilpdNyuj1df8odxD
J0wAn31iBCt7mxyRfKvY/epaybgypN60
=hr6J
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list