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

  • Committer: Martin
  • Date: 2017-06-05 20:48:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6658.
  • Revision ID: gzlist@googlemail.com-20170605204831-20accykspjcrx0a8
Apply 2to3 dict fixer and clean up resulting mess using view helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
from .sixish import (
82
82
    BytesIO,
83
83
    text_type,
 
84
    viewitems,
 
85
    viewvalues,
84
86
)
85
87
from .trace import mutter, note, warning, is_quiet, get_verbosity_level
86
88
 
201
203
        reference = control_dir.get_branch_reference()
202
204
    except errors.NotBranchError:
203
205
        # There is no active branch, just return the colocated branches.
204
 
        for name, branch in control_dir.get_branches().iteritems():
 
206
        for name, branch in viewitems(control_dir.get_branches()):
205
207
            yield name, branch
206
208
        return
207
209
    if reference is not None:
212
214
    if ref_branch is None or ref_branch.name:
213
215
        if ref_branch is not None:
214
216
            control_dir = ref_branch.bzrdir
215
 
        for name, branch in control_dir.get_branches().iteritems():
 
217
        for name, branch in viewitems(control_dir.get_branches()):
216
218
            yield name, branch
217
219
    else:
218
220
        repo = ref_branch.bzrdir.find_repository()
845
847
        self.cleanup_now()
846
848
        if len(ignored) > 0:
847
849
            if verbose:
848
 
                for glob in sorted(ignored.keys()):
 
850
                for glob in sorted(ignored):
849
851
                    for path in ignored[glob]:
850
852
                        self.outf.write(
851
853
                         gettext("ignored {0} matching \"{1}\"\n").format(
1583
1585
                names[name] = active
1584
1586
            # Only mention the current branch explicitly if it's not
1585
1587
            # one of the colocated branches
1586
 
            if not any(names.values()) and active_branch is not None:
 
1588
            if not any(viewvalues(names)) and active_branch is not None:
1587
1589
                self.outf.write("* %s\n" % gettext("(default)"))
1588
 
            for name in sorted(names.keys()):
 
1590
            for name in sorted(names):
1589
1591
                active = names[name]
1590
1592
                if active:
1591
1593
                    prefix = "*"
3963
3965
    def print_aliases(self):
3964
3966
        """Print out the defined aliases in a similar format to bash."""
3965
3967
        aliases = _mod_config.GlobalConfig().get_aliases()
3966
 
        for key, value in sorted(aliases.iteritems()):
 
3968
        for key, value in sorted(viewitems(aliases)):
3967
3969
            self.outf.write('brz alias %s="%s"\n' % (key, value))
3968
3970
 
3969
3971
    @display_command
6004
6006
        from .tag import tag_sort_methods
6005
6007
        branch, relpath = Branch.open_containing(directory)
6006
6008
 
6007
 
        tags = branch.tags.get_tag_dict().items()
 
6009
        tags = list(viewitems(branch.tags.get_tag_dict()))
6008
6010
        if not tags:
6009
6011
            return
6010
6012
 
6648
6650
        if tree is None:
6649
6651
            tree = branch.basis_tree()
6650
6652
        if path is None:
6651
 
            info = branch._get_all_reference_info().iteritems()
 
6653
            info = viewitems(branch._get_all_reference_info())
6652
6654
            self._display_reference_info(tree, branch, info)
6653
6655
        else:
6654
6656
            file_id = tree.path2id(path)