/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

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