[MERGE] Cache ghosts when we can get them from a RemoteRepository in get_parent_map.

Andrew Bennetts andrew.bennetts at canonical.com
Tue Mar 24 12:32:36 GMT 2009


Robert Collins wrote:
[...]
> +            # XXX: Full scan of cache, keeping a set of cached keys will scale
> +            # better.
> +            needed_revisions = set(key for key in keys if key not in cache)

Is that XXX comment still accurate?  I think this code is now looping over
the requested keys, not the full cache.

> +    def note_missing_key(self, key):
> +        """Note that key is a missing key."""
> +        if self._cache_misses:
> +            self.missing_keys.add(key)

Perhaps "mark" or "record" would be a better verb than "note"?  "note" is ok
though.

> === modified file 'bzrlib/smart/repository.py'
> --- bzrlib/smart/repository.py	2009-03-17 06:18:16 +0000
> +++ bzrlib/smart/repository.py	2009-03-24 06:07:35 +0000
> @@ -134,6 +134,10 @@
>          from revision_ids is returned. The verb takes a body containing the
>          current search state, see do_body for details.
>  
> +        If 'include-missing' is in revision_ids, ghosts encountered in the

'include-missing:' with a colon.

> === modified file 'bzrlib/tests/test_remote.py'
[...]
> @@ -2343,7 +2395,7 @@
>          rev_ord, expected_revs = self.get_ordered_revs('knit', 'topological')
>          self.assertEqual(expected_revs, rev_ord)
>          # Getting topological sort requires VFS calls still
> -        self.assertLength(14, self.hpss_calls)
> +        self.assertLength(13, self.hpss_calls)

Nice.

Everything else looks good to me.

bb:approve

-Andrew.




More information about the bazaar mailing list