/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/bzr/groupcompress_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2020-07-05 12:50:01 UTC
  • mfrom: (7490.40.46 work)
  • mto: (7490.40.48 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200705125001-7s3vo0p55szbbws7
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Repository formats using CHK inventories and groupcompress compression."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
import time
20
22
 
21
23
from .. import (
57
59
from ..bzr.vf_repository import (
58
60
    StreamSource,
59
61
    )
 
62
from ..sixish import (
 
63
    viewitems,
 
64
    viewvalues,
 
65
    )
60
66
from ..static_tuple import StaticTuple
61
67
 
62
68
 
281
287
                next_keys = set()
282
288
 
283
289
                def handle_internal_node(node):
284
 
                    for prefix, value in node._items.items():
 
290
                    for prefix, value in viewitems(node._items):
285
291
                        # We don't want to request the same key twice, and we
286
292
                        # want to order it by the first time it is seen.
287
293
                        # Even further, we don't want to request a key which is
543
549
        ancestor_keys = revision_vf.get_parent_map(revision_vf.keys())
544
550
        # Strip keys back into revision_ids.
545
551
        ancestors = dict((k[0], tuple([p[0] for p in parents]))
546
 
                         for k, parents in ancestor_keys.items())
 
552
                         for k, parents in viewitems(ancestor_keys))
547
553
        del ancestor_keys
548
554
        # TODO: _generate_text_key_index should be much cheaper to generate from
549
555
        #       a chk repository, rather than the current implementation
665
671
                if search_key_name is None:
666
672
                    # Find the name corresponding to the search_key_func
667
673
                    search_key_reg = chk_map.search_key_registry
668
 
                    for search_key_name, func in search_key_reg.items():
 
674
                    for search_key_name, func in viewitems(search_key_reg):
669
675
                        if func == chk_inv.id_to_entry._search_key_func:
670
676
                            break
671
677
                canonical_inv = inventory.CHKInventory.from_inventory(
742
748
        # any present parent inventories, which may be used when calculating
743
749
        # deltas for streaming.
744
750
        all_inv_keys = set(corresponding_invs)
745
 
        for parent_inv_keys in inv_parent_map.values():
 
751
        for parent_inv_keys in viewvalues(inv_parent_map):
746
752
            all_inv_keys.update(parent_inv_keys)
747
753
        # Filter out ghost parents.
748
754
        all_inv_keys.intersection_update(