/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/git/dir.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:
19
19
 
20
20
from __future__ import absolute_import
21
21
 
22
 
import contextlib
23
 
 
24
22
from .. import (
25
23
    branch as _mod_branch,
 
24
    cleanup,
26
25
    errors as brz_errors,
27
26
    trace,
28
27
    osutils,
29
28
    urlutils,
30
29
    )
 
30
from ..sixish import (
 
31
    PY3,
 
32
    viewitems,
 
33
    )
31
34
from ..transport import (
32
35
    do_catching_redirections,
33
36
    get_transport_from_path,
189
192
        else:
190
193
            wt = None
191
194
        if recurse == 'down':
192
 
            with contextlib.ExitStack() as stack:
 
195
            with cleanup.ExitStack() as stack:
193
196
                basis = None
194
197
                if wt is not None:
195
198
                    basis = wt.basis_tree()
247
250
            determine_wants = interrepo.determine_wants_all
248
251
        (pack_hint, _, refs) = interrepo.fetch_objects(determine_wants,
249
252
                                                       mapping=default_mapping)
250
 
        for name, val in refs.items():
 
253
        for name, val in viewitems(refs):
251
254
            target_git_repo.refs[name] = val
252
255
        result_dir = self.__class__(transport, target_git_repo, format)
253
256
        if revision_id is not None:
563
566
            else:
564
567
                base_url = urlutils.local_path_to_url(
565
568
                    commondir.decode(osutils._fs_enc)).rstrip('/.git/') + '/'
 
569
            if not PY3:
 
570
                params = {k: v.encode('utf-8') for (k, v) in viewitems(params)}
566
571
            return urlutils.join_segment_parameters(base_url, params)
567
572
        return None
568
573