/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/conflicts.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-03 23:21:15 UTC
  • mfrom: (7290.42.6 paramiko-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200203232115-g7k11bhsfeiqcprv
Fix compatibility with newer versions of paramiko, which break on noise before keys in pem files.

Merged from https://code.launchpad.net/~jelmer/brz/paramiko-compat/+merge/378480

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    option,
43
43
    registry,
44
44
    )
 
45
from .sixish import text_type
45
46
 
46
47
 
47
48
CONFLICT_SUFFIXES = ('.THIS', '.BASE', '.OTHER')
76
77
                    continue
77
78
                self.outf.write(conflict.path + '\n')
78
79
            else:
79
 
                self.outf.write(str(conflict) + '\n')
 
80
                self.outf.write(text_type(conflict) + '\n')
80
81
 
81
82
 
82
83
resolve_action_registry = registry.Registry()
153
154
                    before - after)
154
155
                trace.note(gettext('Remaining conflicts:'))
155
156
                for conflict in tree.conflicts():
156
 
                    trace.note(str(conflict))
 
157
                    trace.note(text_type(conflict))
157
158
                return 1
158
159
            else:
159
160
                trace.note(gettext('All conflicts resolved.'))
288
289
    def to_strings(self):
289
290
        """Generate strings for the provided conflicts"""
290
291
        for conflict in self:
291
 
            yield str(conflict)
 
292
            yield text_type(conflict)
292
293
 
293
294
    def remove_files(self, tree):
294
295
        """Remove the THIS, BASE and OTHER files for listed conflicts"""
361
362
        self.path = path
362
363
        # the factory blindly transfers the Stanza values to __init__ and
363
364
        # Stanza is purely a Unicode api.
364
 
        if isinstance(file_id, str):
 
365
        if isinstance(file_id, text_type):
365
366
            file_id = cache_utf8.encode(file_id)
366
367
        self.file_id = osutils.safe_file_id(file_id)
367
368
 
735
736
        self.conflict_path = conflict_path
736
737
        # the factory blindly transfers the Stanza values to __init__,
737
738
        # so they can be unicode.
738
 
        if isinstance(conflict_file_id, str):
 
739
        if isinstance(conflict_file_id, text_type):
739
740
            conflict_file_id = cache_utf8.encode(conflict_file_id)
740
741
        self.conflict_file_id = osutils.safe_file_id(conflict_file_id)
741
742