/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-21 04:28:46 UTC
  • mfrom: (7494 work)
  • mto: This revision was merged to the branch mainline in revision 7496.
  • Revision ID: jelmer@jelmer.uk-20200221042846-r8lzqu0jetkw772i
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""An adapter between a Git control dir and a Bazaar ControlDir."""
19
19
 
20
 
from __future__ import absolute_import
 
20
import contextlib
21
21
 
22
22
from .. import (
23
23
    branch as _mod_branch,
24
 
    cleanup,
25
24
    errors as brz_errors,
26
25
    trace,
27
26
    osutils,
28
27
    urlutils,
29
28
    )
30
 
from ..sixish import (
31
 
    PY3,
32
 
    viewitems,
33
 
    )
34
29
from ..transport import (
35
30
    do_catching_redirections,
36
31
    get_transport_from_path,
192
187
        else:
193
188
            wt = None
194
189
        if recurse == 'down':
195
 
            with cleanup.ExitStack() as stack:
 
190
            with contextlib.ExitStack() as stack:
196
191
                basis = None
197
192
                if wt is not None:
198
193
                    basis = wt.basis_tree()
250
245
            determine_wants = interrepo.determine_wants_all
251
246
        (pack_hint, _, refs) = interrepo.fetch_objects(determine_wants,
252
247
                                                       mapping=default_mapping)
253
 
        for name, val in viewitems(refs):
 
248
        for name, val in refs.items():
254
249
            target_git_repo.refs[name] = val
255
250
        result_dir = self.__class__(transport, target_git_repo, format)
256
251
        if revision_id is not None:
566
561
            else:
567
562
                base_url = urlutils.local_path_to_url(
568
563
                    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
564
            return urlutils.join_segment_parameters(base_url, params)
572
565
        return None
573
566