[MERGE] Allow insert_record_stream to partially insert a stream rather than error when there are missing compression parents

Andrew Bennetts andrew.bennetts at canonical.com
Tue Feb 17 04:06:30 GMT 2009


This patch relaxes VersionedFiles.insert_record_stream a little.  For
repositories where it is possible to do so safely, it will allow records
missing a compression parent to be written.  For knits that would be writing
a record to the .knit but not .kndx.  When suspendable write groups lands
packs will support it too (by disallowing the insertion of a pack when there
are still missing references, although such a pack may be suspended).

Callers of insert_record_stream can discover which compression parents are
missing via the new get_missing_compression_parents API on VersionedFiles.

The point of this is to allow smart push to push records safely and
efficiently to stacked repositories in two round-trips:

  1. send delta records for all the revisions we're pushing, then
  2. send fulltexts for records missing compression parents — if any.

(Other strategies would be possible if we want to experiment with different
tradeoffs for number of round-trips vs. number of excess fulltexts sent.
This is essentially what the VFS code does today, although it looks before
it leaps.)

For repositories that can't support this (weaves, for example), their
versioned files' insert_record_stream may still raise RevisionNotPresent.

Oh, and this patch also fixes the test for insert_record_stream with missing
parents to test what it claims to, as well as updating it for the new
behaviour!

-Andrew.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: insert_record_stream-missing-parents-4012.patch
Type: text/x-diff
Size: 15414 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090217/14302943/attachment-0001.bin 


More information about the bazaar mailing list