[MERGE] Implement and use Repository.iter_files_bytes

Robert Collins robertc at robertcollins.net
Sun Aug 19 22:25:17 BST 2007


On Thu, 2007-08-16 at 07:58 -0400, Aaron Bentley wrote:
bb:resubmit

> Hi all,
> 
> This bundle implements a new interface for getting file contents:
> 
> Tree and Repository.iter_files_bytes.
> 
> It will be highly efficient on pack repos, requiring a single readv to
> extract all desired texts.  This should greatly improve build_tree
> performance.  It currently is a negligible improvement for knits.
> 
> This patch also changes build_tree and revert to use Tree.iter_files_bytes.
> 
> I propose merging this now, to reduce code divergence between Robert's
> branch and the mainline.

Thanks - I haven't merged this to my branch yet, I will be today as part
of checking 'checkout' does not regress in speed.

It looks good, though at one point you describe (file_id, revision_id,
opaque) as a pair - ((file_id, revision_id), opaque) would be a pair -
the former is a triple or just tuple.

Secondly, I think a test for extracting two texts from one file id would
be good to have; and also I think there are a couple of key failure
cases missing. Specifically what happens when a missing key is
encountered (does the repository silently skip over it (letting the
caller do housekeeping), or does it raise an error at the end of the
iterator (easier for the common caller case I suspect)?) This probably
needs to be tested both at the interface of the repository, and also as
an input to TT, to see that TT doesn't get confused.

Cheers,
Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070820/134dbd0e/attachment.pgp 


More information about the bazaar mailing list