/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-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from __future__ import absolute_import
18
18
 
 
19
import contextlib
19
20
import difflib
20
21
import os
21
22
import re
29
30
import tempfile
30
31
 
31
32
from breezy import (
32
 
    cleanup,
33
33
    controldir,
34
34
    osutils,
35
35
    textfile,
47
47
from .registry import (
48
48
    Registry,
49
49
    )
50
 
from .sixish import text_type
51
50
from .trace import mutter, note, warning
52
51
from .tree import FileTimestampUnavailable
53
52
 
519
518
        context = DEFAULT_CONTEXT_AMOUNT
520
519
    if format_cls is None:
521
520
        format_cls = DiffTree
522
 
    with cleanup.ExitStack() as exit_stack:
 
521
    with contextlib.ExitStack() as exit_stack:
523
522
        exit_stack.enter_context(old_tree.lock_read())
524
523
        if extra_trees is not None:
525
524
            for tree in extra_trees:
802
801
        if sys.platform == 'win32':  # Popen doesn't accept unicode on win32
803
802
            command_encoded = []
804
803
            for c in command:
805
 
                if isinstance(c, text_type):
 
804
                if isinstance(c, str):
806
805
                    command_encoded.append(c.encode('mbcs'))
807
806
                else:
808
807
                    command_encoded.append(c)