/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/multiwalker.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:
17
17
"""Walk multiple trees simultaneously.
18
18
"""
19
19
 
 
20
from __future__ import absolute_import
 
21
 
20
22
from . import (
21
23
    errors,
22
24
    osutils,
23
25
    )
24
26
 
 
27
from .sixish import (
 
28
    text_type,
 
29
    viewvalues,
 
30
    )
 
31
 
25
32
 
26
33
class MultiWalker(object):
27
34
    """Walk multiple trees simultaneously, getting combined results."""
87
94
        # This is stolen from _dirstate_helpers_py.py, only switching it to
88
95
        # Unicode objects. Consider using encode_utf8() and then using the
89
96
        # optimized versions, or maybe writing optimized unicode versions.
90
 
        if not isinstance(path1, str):
 
97
        if not isinstance(path1, text_type):
91
98
            raise TypeError("'path1' must be a unicode string, not %s: %r"
92
99
                            % (type(path1), path1))
93
 
        if not isinstance(path2, str):
 
100
        if not isinstance(path2, text_type):
94
101
            raise TypeError("'path2' must be a unicode string, not %s: %r"
95
102
                            % (type(path2), path2))
96
103
        return (MultiWalker._path_to_key(path1) <
240
247
        #       might ensure better ordering, in case a caller strictly
241
248
        #       requires parents before children.
242
249
        for idx, other_extra in enumerate(self._others_extra):
243
 
            others = sorted(other_extra.values(),
 
250
            others = sorted(viewvalues(other_extra),
244
251
                            key=lambda x: self._path_to_key(x[0]))
245
252
            for other_path, other_ie in others:
246
253
                file_id = other_ie.file_id