/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-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

Show diffs side-by-side

added added

removed removed

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