/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: 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
# TODO: 'brz resolve' should accept a directory name and work from that
18
18
# point down
19
19
 
 
20
from __future__ import absolute_import
 
21
 
20
22
import os
21
23
import re
22
24
 
40
42
    option,
41
43
    registry,
42
44
    )
 
45
from .sixish import text_type
43
46
 
44
47
 
45
48
CONFLICT_SUFFIXES = ('.THIS', '.BASE', '.OTHER')
74
77
                    continue
75
78
                self.outf.write(conflict.path + '\n')
76
79
            else:
77
 
                self.outf.write(str(conflict) + '\n')
 
80
                self.outf.write(text_type(conflict) + '\n')
78
81
 
79
82
 
80
83
resolve_action_registry = registry.Registry()
151
154
                    before - after)
152
155
                trace.note(gettext('Remaining conflicts:'))
153
156
                for conflict in tree.conflicts():
154
 
                    trace.note(str(conflict))
 
157
                    trace.note(text_type(conflict))
155
158
                return 1
156
159
            else:
157
160
                trace.note(gettext('All conflicts resolved.'))
286
289
    def to_strings(self):
287
290
        """Generate strings for the provided conflicts"""
288
291
        for conflict in self:
289
 
            yield str(conflict)
 
292
            yield text_type(conflict)
290
293
 
291
294
    def remove_files(self, tree):
292
295
        """Remove the THIS, BASE and OTHER files for listed conflicts"""
359
362
        self.path = path
360
363
        # the factory blindly transfers the Stanza values to __init__ and
361
364
        # Stanza is purely a Unicode api.
362
 
        if isinstance(file_id, str):
 
365
        if isinstance(file_id, text_type):
363
366
            file_id = cache_utf8.encode(file_id)
364
367
        self.file_id = file_id
365
368
 
733
736
        self.conflict_path = conflict_path
734
737
        # the factory blindly transfers the Stanza values to __init__,
735
738
        # so they can be unicode.
736
 
        if isinstance(conflict_file_id, str):
 
739
        if isinstance(conflict_file_id, text_type):
737
740
            conflict_file_id = cache_utf8.encode(conflict_file_id)
738
741
        self.conflict_file_id = conflict_file_id
739
742