/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/commands.py

  • Committer: Jelmer Vernooij
  • Date: 2020-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
"""Git-specific subcommands for Bazaar."""
23
23
 
24
 
from __future__ import absolute_import
25
 
 
26
24
import breezy.bzr  # noqa: F401
27
25
from breezy import controldir
28
26
from ..commands import (
33
31
    Option,
34
32
    RegistryOption,
35
33
    )
36
 
from ..sixish import (
37
 
    text_type,
38
 
    viewitems,
39
 
    )
40
34
 
41
35
 
42
36
class cmd_git_import(Command):
141
135
        mapping = source_repo.get_mapping()
142
136
        result = interrepo.fetch()
143
137
        with ui.ui_factory.nested_progress_bar() as pb:
144
 
            for i, (name, sha) in enumerate(viewitems(result.refs)):
 
138
            for i, (name, sha) in enumerate(result.refs.items()):
145
139
                try:
146
140
                    branch_name = ref_to_branch_name(name)
147
141
                except ValueError:
186
180
    takes_args = ["sha1?"]
187
181
    takes_options = [Option('directory',
188
182
                            short_name='d',
189
 
                            help='Location of repository.', type=text_type),
 
183
                            help='Location of repository.', type=str),
190
184
                     Option('pretty', help='Pretty-print objects.')]
191
185
    encoding_type = 'exact'
192
186
 
247
241
        object_store = get_object_store(repo)
248
242
        with object_store.lock_read():
249
243
            refs = get_refs_container(controldir, object_store)
250
 
            for k, v in sorted(viewitems(refs.as_dict())):
 
244
            for k, v in sorted(refs.as_dict().items()):
251
245
                self.outf.write("%s -> %s\n" %
252
246
                                (k.decode('utf-8'), v.decode('utf-8')))
253
247
 
304
298
 
305
299
    takes_options = [Option('directory',
306
300
                            short_name='d',
307
 
                            help='Location of repository.', type=text_type)]
 
301
                            help='Location of repository.', type=str)]
308
302
    takes_args = ['target', 'package']
309
303
 
310
304
    def run(self, target, package, directory='.'):