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

  • Committer: Jelmer Vernooij
  • Date: 2020-03-22 01:35:14 UTC
  • mfrom: (7490.7.6 work)
  • mto: This revision was merged to the branch mainline in revision 7499.
  • Revision ID: jelmer@jelmer.uk-20200322013514-7vw1ntwho04rcuj3
merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
 
17
import contextlib
19
18
import difflib
20
19
import os
21
20
import re
29
28
import tempfile
30
29
 
31
30
from breezy import (
32
 
    cleanup,
33
31
    controldir,
34
32
    osutils,
35
33
    textfile,
47
45
from .registry import (
48
46
    Registry,
49
47
    )
50
 
from .sixish import text_type
51
48
from .trace import mutter, note, warning
52
49
from .tree import FileTimestampUnavailable
53
50
 
519
516
        context = DEFAULT_CONTEXT_AMOUNT
520
517
    if format_cls is None:
521
518
        format_cls = DiffTree
522
 
    with cleanup.ExitStack() as exit_stack:
 
519
    with contextlib.ExitStack() as exit_stack:
523
520
        exit_stack.enter_context(old_tree.lock_read())
524
521
        if extra_trees is not None:
525
522
            for tree in extra_trees:
802
799
        if sys.platform == 'win32':  # Popen doesn't accept unicode on win32
803
800
            command_encoded = []
804
801
            for c in command:
805
 
                if isinstance(c, text_type):
 
802
                if isinstance(c, str):
806
803
                    command_encoded.append(c.encode('mbcs'))
807
804
                else:
808
805
                    command_encoded.append(c)