/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

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)