/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/vf_search.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
"""Searching in versioned file repositories."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
import itertools
20
22
 
21
23
from .. import (
29
31
    Graph,
30
32
    invert_parent_map,
31
33
    )
 
34
from ..sixish import (
 
35
    viewvalues,
 
36
    )
32
37
 
33
38
 
34
39
class AbstractSearchResult(object):
381
386
    # start_set is all the keys in the cache
382
387
    start_set = set(parent_map)
383
388
    # result set is all the references to keys in the cache
384
 
    result_parents = set(itertools.chain.from_iterable(parent_map.values()))
 
389
    result_parents = set(itertools.chain.from_iterable(viewvalues(parent_map)))
385
390
    stop_keys = result_parents.difference(start_set)
386
391
    # We don't need to send ghosts back to the server as a position to
387
392
    # stop either.
419
424
            next_revs = next(s)
420
425
        except StopIteration:
421
426
            break
422
 
        for parents in s._current_parents.values():
 
427
        for parents in viewvalues(s._current_parents):
423
428
            f_heads = heads.intersection(parents)
424
429
            if f_heads:
425
430
                found_heads.update(f_heads)
426
431
        stop_keys = exclude_keys.intersection(next_revs)
427
432
        if stop_keys:
428
433
            s.stop_searching_any(stop_keys)
429
 
    for parents in s._current_parents.values():
 
434
    for parents in viewvalues(s._current_parents):
430
435
        f_heads = heads.intersection(parents)
431
436
        if f_heads:
432
437
            found_heads.update(f_heads)