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