/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-06-12 01:45:56 UTC
  • mfrom: (7513.1.2 pypy3)
  • Revision ID: breezy.the.bot@gmail.com-20200612014556-tsc8assk3d0luziu
Avoid deprecated behaviour in ElementTree.

Merged from https://code.launchpad.net/~jelmer/brz/pypy3/+merge/385611

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()
252
247
            determine_wants = interrepo.determine_wants_all
253
248
        (pack_hint, _, refs) = interrepo.fetch_objects(determine_wants,
254
249
                                                       mapping=default_mapping)
255
 
        for name, val in viewitems(refs):
 
250
        for name, val in refs.items():
256
251
            target_git_repo.refs[name] = val
257
252
        result_dir = LocalGitDir(transport, target_git_repo, format)
258
253
        if revision_id is not None:
583
578
            else:
584
579
                base_url = urlutils.local_path_to_url(
585
580
                    commondir.decode(osutils._fs_enc)).rstrip('/.git/') + '/'
586
 
            if not PY3:
587
 
                params = {k: v.encode('utf-8') for (k, v) in viewitems(params)}
588
581
            return urlutils.join_segment_parameters(base_url, params)
589
582
        return None
590
583