/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-06-12 01:45:56 UTC
  • mfrom: (7513.1.2 pypy3)
  • Revision ID: breezy.the.bot@gmail.com-20200612014556-tsc8assk3d0luziu
Avoid deprecated behaviour in ElementTree.

Merged from https://code.launchpad.net/~jelmer/brz/pypy3/+merge/385611

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