[MERGE][bug #300177] Pass compression_parent as part of 'get_record_stream'

Robert Collins robertc at robertcollins.net
Fri Feb 6 22:49:40 GMT 2009


On Fri, 2009-02-06 at 16:19 -0600, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> > I may have missed something here John, whats the intent of this?
> > 
> > [background - I considered exposing this initially, but decided it made
> > more sense as a private member of factories which use compression
> > parents, because its not something that makes sense for all compression
> > types]
> > 
> > -Rob
> > 
> 
> So... insert_record_stream() already asks about compression parents. It
> does that in places like "do I have the compression parent so I know I'm
> safe to insert this now". It seemed better to be explicit about it,
> rather than assume that parents[0] is the compression parent.
> 
> Further, when vila started his work or bug 277537, he initially thought
> that "bzr reconcile" would swap the parent order without regenerating
> the text delta, thus having the compression parent be a non-lhs parent.
> Which would break in very bad ways long-term. (If you have a stacked
> branch, and you created a new full-history copy from it, any deltas that
> pointed to non-lhs parents would silently be changed to point to lhs
> parents, and thus end up with knit corruption.)
> 
> I figured it would be better to start making more code aware of non-lhs
> compression parents early rather than late, even if we should *not* try
> to do this with existing repository formats, because older clients are
> "known broken" under those conditions.

I agree with being explicit about it; but I'm saying that I don't think
its a public interface.

Its only relevant, and useful, to knits-in-pack code. its irrelevant for
weaves/gc/jbof.

So I think its fine to say 'KnitContentFactory has a compression_parent
field, which is set if and only if the source knit supports arbitrary
parents' or something like that. But saying 'all content factories have
a compression_parents field' muddies the interface by making public -
and thus something any code can inspect - something that only a few
(none today) sources could actually use.

So if its private to KnitContentFactory, then the only users of it are
those that know specifically about KnitContentFactory - that is the
adapters from *knit* content types. This also keeps the awareness of the
detail from leaking outside the abstraction.

-Rob
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090207/61947a65/attachment.pgp 


More information about the bazaar mailing list