/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-03 23:21:15 UTC
  • mfrom: (7290.42.6 paramiko-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200203232115-g7k11bhsfeiqcprv
Fix compatibility with newer versions of paramiko, which break on noise before keys in pem files.

Merged from https://code.launchpad.net/~jelmer/brz/paramiko-compat/+merge/378480

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
20
19
import difflib
21
20
import os
22
21
import re
30
29
import tempfile
31
30
 
32
31
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
50
51
from .trace import mutter, note, warning
51
52
from .tree import FileTimestampUnavailable
52
53
 
518
519
        context = DEFAULT_CONTEXT_AMOUNT
519
520
    if format_cls is None:
520
521
        format_cls = DiffTree
521
 
    with contextlib.ExitStack() as exit_stack:
 
522
    with cleanup.ExitStack() as exit_stack:
522
523
        exit_stack.enter_context(old_tree.lock_read())
523
524
        if extra_trees is not None:
524
525
            for tree in extra_trees:
801
802
        if sys.platform == 'win32':  # Popen doesn't accept unicode on win32
802
803
            command_encoded = []
803
804
            for c in command:
804
 
                if isinstance(c, str):
 
805
                if isinstance(c, text_type):
805
806
                    command_encoded.append(c.encode('mbcs'))
806
807
                else:
807
808
                    command_encoded.append(c)