[MERGE][#354036] Server-side (sink-side) fix for missing inventory parents

Robert Collins robert.collins at canonical.com
Mon Apr 27 03:40:28 BST 2009


BB may not have noticed this.

On Wed, 2009-04-22 at 17:11 +1000, Andrew Bennetts wrote:
> === modified file 'bzrlib/fetch.py'
> --- bzrlib/fetch.py     2009-04-08 05:34:48 +0000
> +++ bzrlib/fetch.py     2009-04-22 06:14:03 +0000
> @@ -137,17 +137,8 @@
>              resume_tokens, missing_keys = self.sink.insert_stream(
>                  stream, from_format, [])
>              if self.to_repository._fallback_repositories:
> -                # Find all the parent revisions referenced by the
> stream, but
> -                # not present in the stream, and make sure we have
> their
> -                # inventories.
> -                revision_ids = search.get_keys()
> -                parent_maps =
> self.to_repository.get_parent_map(revision_ids)
> -                parents = set()
> -                map(parents.update, parent_maps.itervalues())
> -                parents.difference_update(revision_ids)
> -                parents.discard(NULL_REVISION)
>                  missing_keys.update(
> -                    ('inventories', rev_id) for rev_id in parents)
> +                    self._parent_inventories(search.get_keys()))
>              if missing_keys:
>                  pb.update("Missing keys")
>                  stream =
> source.get_stream_for_missing_keys(missing_keys)

It would be nice to put an upper time limit on how long we have the
client do this - it is an extra round trip that the sink should be
telling us anyway.

> @@ -2818,6 +2829,10 @@
>              new_missing =
> graph_index.external_references(ref_list_num=1)
> 
> new_missing.difference_update(self.get_parent_map(new_missing))
>              self._missing_compression_parents.update(new_missing)
> +        if self._external_parent_refs is not None:
> +            for node in graph_index.iter_all_entries():
> +                self._external_parent_refs.update(node[3][0])
> +                self._external_parent_refs.discard(node[1])

Because the code is a little opaque, a one-liner here about what these 4
lines do would be good.


> @@ -4310,3 +4339,4 @@
>              yield versionedfile.FulltextContentFactory(
>                  key, parent_keys, None, as_bytes)
>  
> +
> 

^ unnecessary VWS



bb:tweak.

-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/20090427/64f69553/attachment.pgp 


More information about the bazaar mailing list