/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: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
 
23
 
import brzlib.bzrdir
 
23
import breezy.bzrdir
24
24
 
25
 
from brzlib import lazy_import
 
25
from breezy import lazy_import
26
26
lazy_import.lazy_import(globals(), """
27
27
import cStringIO
28
28
import errno
29
29
import sys
30
30
import time
31
31
 
32
 
import brzlib
33
 
from brzlib import (
 
32
import breezy
 
33
from breezy import (
34
34
    bugtracker,
35
35
    bundle,
36
36
    btree_index,
56
56
    views,
57
57
    gpg,
58
58
    )
59
 
from brzlib.branch import Branch
60
 
from brzlib.conflicts import ConflictList
61
 
from brzlib.transport import memory
62
 
from brzlib.revisionspec import RevisionSpec, RevisionInfo
63
 
from brzlib.smtp_connection import SMTPConnection
64
 
from brzlib.workingtree import WorkingTree
65
 
from brzlib.i18n import gettext, ngettext
 
59
from breezy.branch import Branch
 
60
from breezy.conflicts import ConflictList
 
61
from breezy.transport import memory
 
62
from breezy.revisionspec import RevisionSpec, RevisionInfo
 
63
from breezy.smtp_connection import SMTPConnection
 
64
from breezy.workingtree import WorkingTree
 
65
from breezy.i18n import gettext, ngettext
66
66
""")
67
67
 
68
 
from brzlib.commands import (
 
68
from breezy.commands import (
69
69
    Command,
70
70
    builtin_command_registry,
71
71
    display_command,
72
72
    )
73
 
from brzlib.option import (
 
73
from breezy.option import (
74
74
    ListOption,
75
75
    Option,
76
76
    RegistryOption,
77
77
    custom_help,
78
78
    _parse_revision_str,
79
79
    )
80
 
from brzlib.trace import mutter, note, warning, is_quiet, get_verbosity_level
81
 
from brzlib import (
 
80
from breezy.trace import mutter, note, warning, is_quiet, get_verbosity_level
 
81
from breezy import (
82
82
    symbol_versioning,
83
83
    )
84
84
 
391
391
    def run(self, show_ids=False, file_list=None, revision=None, short=False,
392
392
            versioned=False, no_pending=False, verbose=False,
393
393
            no_classify=False):
394
 
        from brzlib.status import show_tree_status
 
394
        from breezy.status import show_tree_status
395
395
 
396
396
        if revision and len(revision) > 2:
397
397
            raise errors.BzrCommandError(gettext('brz status --revision takes exactly'
817
817
 
818
818
    def run(self, file_list, no_recurse=False, dry_run=False, verbose=False,
819
819
            file_ids_from=None):
820
 
        import brzlib.add
 
820
        import breezy.add
821
821
 
822
822
        base_tree = None
823
823
        if file_ids_from is not None:
829
829
                                            file_ids_from)
830
830
                base_tree = base_branch.basis_tree()
831
831
 
832
 
            action = brzlib.add.AddFromBaseAction(base_tree, base_path,
 
832
            action = breezy.add.AddFromBaseAction(base_tree, base_path,
833
833
                          to_file=self.outf, should_print=(not is_quiet()))
834
834
        else:
835
 
            action = brzlib.add.AddWithSkipLargeAction(to_file=self.outf,
 
835
            action = breezy.add.AddWithSkipLargeAction(to_file=self.outf,
836
836
                should_print=(not is_quiet()))
837
837
 
838
838
        if base_tree:
1324
1324
        use_existing_dir=False, directory=None, stacked_on=None,
1325
1325
        stacked=False, strict=None, no_tree=False,
1326
1326
        overwrite_tags=False):
1327
 
        from brzlib.push import _show_push_branch
 
1327
        from breezy.push import _show_push_branch
1328
1328
 
1329
1329
        if overwrite:
1330
1330
            overwrite = ["history", "tags"]
1440
1440
            hardlink=False, stacked=False, standalone=False, no_tree=False,
1441
1441
            use_existing_dir=False, switch=False, bind=False,
1442
1442
            files_from=None):
1443
 
        from brzlib import switch as _mod_switch
1444
 
        from brzlib.tag import _merge_tags_if_possible
 
1443
        from breezy import switch as _mod_switch
 
1444
        from breezy.tag import _merge_tags_if_possible
1445
1445
        if self.invoked_as in ['get', 'clone']:
1446
1446
            ui.ui_factory.show_user_warning(
1447
1447
                'deprecated_command',
1848
1848
            noise_level = get_verbosity_level()
1849
1849
        else:
1850
1850
            noise_level = 0
1851
 
        from brzlib.info import show_bzrdir_info
 
1851
        from breezy.info import show_bzrdir_info
1852
1852
        show_bzrdir_info(controldir.ControlDir.open_containing(location)[0],
1853
1853
                         verbose=noise_level, outfile=self.outf)
1854
1854
 
1980
1980
        ]
1981
1981
 
1982
1982
    def run(self, branch=".", canonicalize_chks=False):
1983
 
        from brzlib.reconcile import reconcile
 
1983
        from breezy.reconcile import reconcile
1984
1984
        dir = controldir.ControlDir.open(branch)
1985
1985
        reconcile(dir, canonicalize_chks=canonicalize_chks)
1986
1986
 
2066
2066
         RegistryOption('format',
2067
2067
                help='Specify a format for this branch. '
2068
2068
                'See "help formats".',
2069
 
                lazy_registry=('brzlib.controldir', 'format_registry'),
 
2069
                lazy_registry=('breezy.controldir', 'format_registry'),
2070
2070
                converter=lambda name: controldir.format_registry.make_bzrdir(name),
2071
2071
                value_switches=True,
2072
2072
                title="Branch format",
2116
2116
                                   force_new_tree=force_new_tree)
2117
2117
            a_bzrdir = branch.bzrdir
2118
2118
        else:
2119
 
            from brzlib.transport.local import LocalTransport
 
2119
            from breezy.transport.local import LocalTransport
2120
2120
            if a_bzrdir.has_branch():
2121
2121
                if (isinstance(to_transport, LocalTransport)
2122
2122
                    and not a_bzrdir.has_workingtree()):
2132
2132
                raise errors.BzrCommandError(gettext('This branch format cannot be set'
2133
2133
                    ' to append-revisions-only.  Try --default.'))
2134
2134
        if not is_quiet():
2135
 
            from brzlib.info import describe_layout, describe_format
 
2135
            from breezy.info import describe_layout, describe_format
2136
2136
            try:
2137
2137
                tree = a_bzrdir.open_workingtree(recommend_upgrade=False)
2138
2138
            except (errors.NoWorkingTree, errors.NotLocalUrl):
2185
2185
    takes_options = [RegistryOption('format',
2186
2186
                            help='Specify a format for this repository. See'
2187
2187
                                 ' "brz help formats" for details.',
2188
 
                            lazy_registry=('brzlib.controldir', 'format_registry'),
 
2188
                            lazy_registry=('breezy.controldir', 'format_registry'),
2189
2189
                            converter=lambda name: controldir.format_registry.make_bzrdir(name),
2190
2190
                            value_switches=True, title='Repository format'),
2191
2191
                     Option('no-trees',
2210
2210
            use_existing_dir=True,
2211
2211
            repo_format_name=format.repository_format.get_format_string()))
2212
2212
        if not is_quiet():
2213
 
            from brzlib.info import show_bzrdir_info
 
2213
            from breezy.info import show_bzrdir_info
2214
2214
            show_bzrdir_info(newdir, verbose=0, outfile=self.outf)
2215
2215
 
2216
2216
 
2326
2326
        RegistryOption('format',
2327
2327
            short_name='F',
2328
2328
            help='Diff format to use.',
2329
 
            lazy_registry=('brzlib.diff', 'format_registry'),
 
2329
            lazy_registry=('breezy.diff', 'format_registry'),
2330
2330
            title='Diff format'),
2331
2331
        Option('context',
2332
2332
            help='How many lines of context to show.',
2340
2340
    def run(self, revision=None, file_list=None, diff_options=None,
2341
2341
            prefix=None, old=None, new=None, using=None, format=None, 
2342
2342
            context=None):
2343
 
        from brzlib.diff import (get_trees_and_branches_to_diff_locked,
 
2343
        from breezy.diff import (get_trees_and_branches_to_diff_locked,
2344
2344
            show_diff_trees)
2345
2345
 
2346
2346
        if (prefix is None) or (prefix == '0'):
2655
2655
            'show-ids',
2656
2656
            'revision',
2657
2657
            Option('change',
2658
 
                   type=brzlib.option._parse_revision_str,
 
2658
                   type=breezy.option._parse_revision_str,
2659
2659
                   short_name='c',
2660
2660
                   help='Show just the specified revision.'
2661
2661
                   ' See also "help revisionspec".'),
2663
2663
            RegistryOption('authors',
2664
2664
                'What names to list as authors - first, all or committer.',
2665
2665
                title='Authors',
2666
 
                lazy_registry=('brzlib.log', 'author_list_registry'),
 
2666
                lazy_registry=('breezy.log', 'author_list_registry'),
2667
2667
            ),
2668
2668
            Option('levels',
2669
2669
                   short_name='n',
2743
2743
            omit_merges=False,
2744
2744
            include_merges=symbol_versioning.DEPRECATED_PARAMETER,
2745
2745
            ):
2746
 
        from brzlib.log import (
 
2746
        from breezy.log import (
2747
2747
            Logger,
2748
2748
            make_log_request_dict,
2749
2749
            _get_info_for_log_files,
3186
3186
 
3187
3187
    def run(self, name_pattern_list=None, default_rules=None,
3188
3188
            directory=u'.'):
3189
 
        from brzlib import ignores
 
3189
        from breezy import ignores
3190
3190
        if default_rules is not None:
3191
3191
            # dump the default rules and exit
3192
3192
            for pattern in ignores.USER_DEFAULTS:
3330
3330
    def run(self, dest, branch_or_subdir=None, revision=None, format=None,
3331
3331
        root=None, filters=False, per_file_timestamps=False, uncommitted=False,
3332
3332
        directory=u'.'):
3333
 
        from brzlib.export import export
 
3333
        from breezy.export import export
3334
3334
 
3335
3335
        if branch_or_subdir is None:
3336
3336
            branch_or_subdir = directory
3418
3418
                    "{0!r} is not present in revision {1}").format(
3419
3419
                        filename, rev_tree.get_revision_id()))
3420
3420
        if filtered:
3421
 
            from brzlib.filter_tree import ContentFilterTree
 
3421
            from breezy.filter_tree import ContentFilterTree
3422
3422
            filter_tree = ContentFilterTree(rev_tree,
3423
3423
                rev_tree._content_filter_stack)
3424
3424
            content = filter_tree.get_file_text(actual_file_id)
3576
3576
            unchanged=False, strict=False, local=False, fixes=None,
3577
3577
            author=None, show_diff=False, exclude=None, commit_time=None,
3578
3578
            lossy=False):
3579
 
        from brzlib.errors import (
 
3579
        from breezy.errors import (
3580
3580
            PointlessCommit,
3581
3581
            ConflictsInTree,
3582
3582
            StrictCommitFailed
3583
3583
        )
3584
 
        from brzlib.msgeditor import (
 
3584
        from breezy.msgeditor import (
3585
3585
            edit_commit_message_encoded,
3586
3586
            generate_commit_message_template,
3587
3587
            make_commit_message_template_encoded,
3766
3766
 
3767
3767
    def run(self, path=None, verbose=False, branch=False, repo=False,
3768
3768
            tree=False):
3769
 
        from brzlib.check import check_dwim
 
3769
        from breezy.check import check_dwim
3770
3770
        if path is None:
3771
3771
            path = '.'
3772
3772
        if not branch and not repo and not tree:
3813
3813
        RegistryOption('format',
3814
3814
            help='Upgrade to a specific format.  See "brz help'
3815
3815
                 ' formats" for details.',
3816
 
            lazy_registry=('brzlib.controldir', 'format_registry'),
 
3816
            lazy_registry=('breezy.controldir', 'format_registry'),
3817
3817
            converter=lambda name: controldir.format_registry.make_bzrdir(name),
3818
3818
            value_switches=True, title='Branch format'),
3819
3819
        Option('clean',
3823
3823
    ]
3824
3824
 
3825
3825
    def run(self, url='.', format=None, clean=False, dry_run=False):
3826
 
        from brzlib.upgrade import upgrade
 
3826
        from breezy.upgrade import upgrade
3827
3827
        exceptions = upgrade(url, format, clean_up=clean, dry_run=dry_run)
3828
3828
        if exceptions:
3829
3829
            if len(exceptions) == 1:
3980
3980
 
3981
3981
    @display_command
3982
3982
    def print_alias(self, alias_name):
3983
 
        from brzlib.commands import get_alias
 
3983
        from breezy.commands import get_alias
3984
3984
        alias = get_alias(alias_name)
3985
3985
        if alias is None:
3986
3986
            self.outf.write("brz alias: %s: not found\n" % alias_name)
4048
4048
    def get_transport_type(typestring):
4049
4049
        """Parse and return a transport specifier."""
4050
4050
        if typestring == "sftp":
4051
 
            from brzlib.tests import stub_sftp
 
4051
            from breezy.tests import stub_sftp
4052
4052
            return stub_sftp.SFTPAbsoluteServer
4053
4053
        elif typestring == "memory":
4054
 
            from brzlib.tests import test_server
 
4054
            from breezy.tests import test_server
4055
4055
            return memory.MemoryServer
4056
4056
        elif typestring == "fakenfs":
4057
 
            from brzlib.tests import test_server
 
4057
            from breezy.tests import test_server
4058
4058
            return test_server.FakeNFSServer
4059
4059
        msg = "No known transport type %s. Supported types are: sftp\n" %\
4060
4060
            (typestring)
4087
4087
                            help='List the tests instead of running them.'),
4088
4088
                     RegistryOption('parallel',
4089
4089
                        help="Run the test suite in parallel.",
4090
 
                        lazy_registry=('brzlib.tests', 'parallel_registry'),
 
4090
                        lazy_registry=('breezy.tests', 'parallel_registry'),
4091
4091
                        value_switches=False,
4092
4092
                        ),
4093
4093
                     Option('randomize', type=str, argname="SEED",
4136
4136
        # backtraces.
4137
4137
        lazy_import.disallow_proxying()
4138
4138
 
4139
 
        from brzlib import tests
 
4139
        from breezy import tests
4140
4140
 
4141
4141
        if testspecs_list is not None:
4142
4142
            pattern = '|'.join(testspecs_list)
4144
4144
            pattern = ".*"
4145
4145
        if subunit:
4146
4146
            try:
4147
 
                from brzlib.tests import SubUnitBzrRunner
 
4147
                from breezy.tests import SubUnitBzrRunner
4148
4148
            except ImportError:
4149
4149
                raise errors.BzrCommandError(gettext("subunit not available. subunit "
4150
4150
                    "needs to be installed to use --subunit."))
4219
4219
 
4220
4220
    @display_command
4221
4221
    def run(self, short=False):
4222
 
        from brzlib.version import show_version
 
4222
        from breezy.version import show_version
4223
4223
        if short:
4224
 
            self.outf.write(brzlib.version_string + '\n')
 
4224
            self.outf.write(breezy.version_string + '\n')
4225
4225
        else:
4226
4226
            show_version(to_file=self.outf)
4227
4227
 
4245
4245
 
4246
4246
    @display_command
4247
4247
    def run(self, branch, other):
4248
 
        from brzlib.revision import ensure_null
 
4248
        from breezy.revision import ensure_null
4249
4249
 
4250
4250
        branch1 = Branch.open_containing(branch)[0]
4251
4251
        branch2 = Branch.open_containing(other)[0]
4478
4478
        return result_tree
4479
4479
 
4480
4480
    def _do_preview(self, merger):
4481
 
        from brzlib.diff import show_diff_trees
 
4481
        from breezy.diff import show_diff_trees
4482
4482
        result_tree = self._get_preview(merger)
4483
4483
        path_encoding = osutils.get_diff_header_encoding()
4484
4484
        show_diff_trees(merger.this_tree, result_tree, self.outf,
4504
4504
        Shelver to selectively remove the differences between the working tree
4505
4505
        and the preview tree.
4506
4506
        """
4507
 
        from brzlib import shelf_ui
 
4507
        from breezy import shelf_ui
4508
4508
        result_tree = self._get_preview(merger)
4509
 
        writer = brzlib.option.diff_writer_registry.get()
 
4509
        writer = breezy.option.diff_writer_registry.get()
4510
4510
        shelver = shelf_ui.Shelver(merger.this_tree, result_tree, destroy=True,
4511
4511
                                   reporter=shelf_ui.ApplyReporter(),
4512
4512
                                   diff_writer=writer(sys.stdout))
4537
4537
    def _get_merger_from_branch(self, tree, location, revision, remember,
4538
4538
                                possible_transports, pb):
4539
4539
        """Produce a merger from a location, assuming it refers to a branch."""
4540
 
        from brzlib.tag import _merge_tags_if_possible
 
4540
        from breezy.tag import _merge_tags_if_possible
4541
4541
        # find the branch locations
4542
4542
        other_loc, user_location = self._select_branch_location(tree, location,
4543
4543
            revision, -1)
4681
4681
 
4682
4682
    def run(self, file_list=None, merge_type=None, show_base=False,
4683
4683
            reprocess=False):
4684
 
        from brzlib.conflicts import restore
 
4684
        from breezy.conflicts import restore
4685
4685
        if merge_type is None:
4686
4686
            merge_type = _mod_merge.Merge3Merger
4687
4687
        tree, file_list = WorkingTree.open_containing_paths(file_list)
4846
4846
 
4847
4847
    @display_command
4848
4848
    def run(self, topic=None, long=False):
4849
 
        import brzlib.help
 
4849
        import breezy.help
4850
4850
        if topic is None and long:
4851
4851
            topic = "commands"
4852
 
        brzlib.help.help(topic)
 
4852
        breezy.help.help(topic)
4853
4853
 
4854
4854
 
4855
4855
class cmd_shell_complete(Command):
4863
4863
 
4864
4864
    @display_command
4865
4865
    def run(self, context=None):
4866
 
        from brzlib import shellcomplete
 
4866
        from breezy import shellcomplete
4867
4867
        shellcomplete.shellcomplete(context)
4868
4868
 
4869
4869
 
4938
4938
            include_merged=None, revision=None, my_revision=None,
4939
4939
            directory=u'.',
4940
4940
            include_merges=symbol_versioning.DEPRECATED_PARAMETER):
4941
 
        from brzlib.missing import find_unmerged, iter_log_revisions
 
4941
        from breezy.missing import find_unmerged, iter_log_revisions
4942
4942
        def message(s):
4943
4943
            if not is_quiet():
4944
4944
                self.outf.write(s)
5126
5126
 
5127
5127
    @display_command
5128
5128
    def run(self, verbose=False):
5129
 
        from brzlib import plugin
 
5129
        from breezy import plugin
5130
5130
        # Don't give writelines a generator as some codecs don't like that
5131
5131
        self.outf.writelines(
5132
5132
            list(plugin.describe_plugins(show_paths=verbose)))
5143
5143
    encoding_type = 'exact'
5144
5144
    @display_command
5145
5145
    def run(self, branch=u'.', revision=None, long=False, strict=False):
5146
 
        from brzlib.testament import Testament, StrictTestament
 
5146
        from breezy.testament import Testament, StrictTestament
5147
5147
        if strict is True:
5148
5148
            testament_class = StrictTestament
5149
5149
        else:
5189
5189
    @display_command
5190
5190
    def run(self, filename, all=False, long=False, revision=None,
5191
5191
            show_ids=False, directory=None):
5192
 
        from brzlib.annotate import (
 
5192
        from breezy.annotate import (
5193
5193
            annotate_file_tree,
5194
5194
            )
5195
5195
        wt, branch, relpath = \
5234
5234
        return self._run(b, revision_id_list, revision)
5235
5235
 
5236
5236
    def _run(self, b, revision_id_list, revision):
5237
 
        import brzlib.gpg as gpg
 
5237
        import breezy.gpg as gpg
5238
5238
        gpg_strategy = gpg.GPGStrategy(b.get_config_stack())
5239
5239
        if revision_id_list is not None:
5240
5240
            b.repository.start_write_group()
5397
5397
 
5398
5398
    def _run(self, b, tree, dry_run, verbose, revision, force, local,
5399
5399
             keep_tags):
5400
 
        from brzlib.log import log_formatter, show_log
5401
 
        from brzlib.uncommit import uncommit
 
5400
        from breezy.log import log_formatter, show_log
 
5401
        from breezy.uncommit import uncommit
5402
5402
 
5403
5403
        last_revno, last_rev_id = b.last_revision_info()
5404
5404
 
5409
5409
        else:
5410
5410
            # 'brz uncommit -r 10' actually means uncommit
5411
5411
            # so that the final tree is at revno 10.
5412
 
            # but brzlib.uncommit.uncommit() actually uncommits
 
5412
            # but breezy.uncommit.uncommit() actually uncommits
5413
5413
            # the revisions that are supplied.
5414
5414
            # So we need to offset it by one
5415
5415
            revno = revision[0].in_history(b).revno + 1
5440
5440
        if not force:
5441
5441
            if not ui.ui_factory.confirm_action(
5442
5442
                    gettext(u'Uncommit these revisions'),
5443
 
                    'brzlib.builtins.uncommit',
 
5443
                    'breezy.builtins.uncommit',
5444
5444
                    {}):
5445
5445
                self.outf.write(gettext('Canceled\n'))
5446
5446
                return 0
5485
5485
        if force:
5486
5486
            ui.ui_factory = ui.ConfirmationUserInterfacePolicy(ui.ui_factory,
5487
5487
                None,
5488
 
                {'brzlib.lockdir.break': True})
 
5488
                {'breezy.lockdir.break': True})
5489
5489
        if config:
5490
5490
            conf = _mod_config.LockableConfig(file_name=location)
5491
5491
            conf.break_lock()
5521
5521
               help='Serve on stdin/out for use from inetd or sshd.'),
5522
5522
        RegistryOption('protocol',
5523
5523
               help="Protocol to serve.",
5524
 
               lazy_registry=('brzlib.transport', 'transport_server_registry'),
 
5524
               lazy_registry=('breezy.transport', 'transport_server_registry'),
5525
5525
               value_switches=True),
5526
5526
        Option('listen',
5527
5527
               help='Listen for connections on nominated address.', type=str),
5547
5547
 
5548
5548
    def run(self, listen=None, port=None, inet=False, directory=None,
5549
5549
            allow_writes=False, protocol=None, client_timeout=None):
5550
 
        from brzlib import transport
 
5550
        from breezy import transport
5551
5551
        if directory is None:
5552
5552
            directory = os.getcwd()
5553
5553
        if protocol is None:
5676
5676
    def run(self, submit_branch=None, public_branch=None, patch_type='bundle',
5677
5677
            sign=False, revision=None, mail_to=None, message=None,
5678
5678
            directory=u'.'):
5679
 
        from brzlib.revision import ensure_null, NULL_REVISION
 
5679
        from breezy.revision import ensure_null, NULL_REVISION
5680
5680
        include_patch, include_bundle = {
5681
5681
            'plain': (False, False),
5682
5682
            'diff': (True, False),
5841
5841
        Option('body', help='Body for the email.', type=unicode),
5842
5842
        RegistryOption('format',
5843
5843
                       help='Use the specified output format.',
5844
 
                       lazy_registry=('brzlib.send', 'format_registry')),
 
5844
                       lazy_registry=('breezy.send', 'format_registry')),
5845
5845
        ]
5846
5846
 
5847
5847
    def run(self, submit_branch=None, public_branch=None, no_bundle=False,
5848
5848
            no_patch=False, revision=None, remember=None, output=None,
5849
5849
            format=None, mail_to=None, message=None, body=None,
5850
5850
            strict=None, **kwargs):
5851
 
        from brzlib.send import send
 
5851
        from breezy.send import send
5852
5852
        return send(submit_branch, revision, public_branch, remember,
5853
5853
                    format, no_bundle, no_patch, output,
5854
5854
                    kwargs.get('from', '.'), mail_to, message, body,
5909
5909
        'revision',
5910
5910
        RegistryOption('format',
5911
5911
                       help='Use the specified output format.',
5912
 
                       lazy_registry=('brzlib.send', 'format_registry')),
 
5912
                       lazy_registry=('breezy.send', 'format_registry')),
5913
5913
        ]
5914
5914
    aliases = ['bundle']
5915
5915
 
5922
5922
            format=None, strict=None, **kwargs):
5923
5923
        if output is None:
5924
5924
            output = '-'
5925
 
        from brzlib.send import send
 
5925
        from breezy.send import send
5926
5926
        return send(submit_branch, revision, public_branch, remember,
5927
5927
                         format, no_bundle, no_patch, output,
5928
5928
                         kwargs.get('from', '.'), None, None, None,
6020
6020
            help='Branch whose tags should be displayed.'),
6021
6021
        RegistryOption('sort',
6022
6022
            'Sort tags by different criteria.', title='Sorting',
6023
 
            lazy_registry=('brzlib.tag', 'tag_sort_methods')
 
6023
            lazy_registry=('breezy.tag', 'tag_sort_methods')
6024
6024
            ),
6025
6025
        'show-ids',
6026
6026
        'revision',
6028
6028
 
6029
6029
    @display_command
6030
6030
    def run(self, directory='.', sort=None, show_ids=False, revision=None):
6031
 
        from brzlib.tag import tag_sort_methods
 
6031
        from breezy.tag import tag_sort_methods
6032
6032
        branch, relpath = Branch.open_containing(directory)
6033
6033
 
6034
6034
        tags = branch.tags.get_tag_dict().items()
6239
6239
 
6240
6240
    def run(self, to_location=None, force=False, create_branch=False,
6241
6241
            revision=None, directory=u'.', store=False):
6242
 
        from brzlib import switch
 
6242
        from breezy import switch
6243
6243
        tree_location = directory
6244
6244
        revision = _get_one_revision('switch', revision)
6245
6245
        possible_transports = []
6540
6540
        Option('all', help='Shelve all changes.'),
6541
6541
        'message',
6542
6542
        RegistryOption('writer', 'Method to use for writing diffs.',
6543
 
                       brzlib.option.diff_writer_registry,
 
6543
                       breezy.option.diff_writer_registry,
6544
6544
                       value_switches=True, enum_switch=False),
6545
6545
 
6546
6546
        Option('list', help='List shelved changes.'),
6553
6553
            writer=None, list=False, destroy=False, directory=None):
6554
6554
        if list:
6555
6555
            return self.run_for_list(directory=directory)
6556
 
        from brzlib.shelf_ui import Shelver
 
6556
        from breezy.shelf_ui import Shelver
6557
6557
        if writer is None:
6558
 
            writer = brzlib.option.diff_writer_registry.get()
 
6558
            writer = breezy.option.diff_writer_registry.get()
6559
6559
        try:
6560
6560
            shelver = Shelver.from_args(writer(sys.stdout), revision, all,
6561
6561
                file_list, message, destroy=destroy, directory=directory)
6609
6609
    _see_also = ['shelve']
6610
6610
 
6611
6611
    def run(self, shelf_id=None, action='apply', directory=u'.'):
6612
 
        from brzlib.shelf_ui import Unshelver
 
6612
        from breezy.shelf_ui import Unshelver
6613
6613
        unshelver = Unshelver.from_args(shelf_id, action, directory=directory)
6614
6614
        try:
6615
6615
            unshelver.run()
6643
6643
                     Option('force', help='Do not prompt before deleting.')]
6644
6644
    def run(self, unknown=False, ignored=False, detritus=False, dry_run=False,
6645
6645
            force=False, directory=u'.'):
6646
 
        from brzlib.clean_tree import clean_tree
 
6646
        from breezy.clean_tree import clean_tree
6647
6647
        if not (unknown or ignored or detritus):
6648
6648
            unknown = True
6649
6649
        if dry_run:
6713
6713
                            ]
6714
6714
 
6715
6715
    def run(self, plugin=None, include_duplicates=False):
6716
 
        from brzlib.export_pot import export_pot
 
6716
        from breezy.export_pot import export_pot
6717
6717
        export_pot(self.outf, plugin, include_duplicates)
6718
6718
 
6719
6719
 
6721
6721
    # register lazy builtins from other modules; called at startup and should
6722
6722
    # be only called once.
6723
6723
    for (name, aliases, module_name) in [
6724
 
        ('cmd_bundle_info', [], 'brzlib.bundle.commands'),
6725
 
        ('cmd_config', [], 'brzlib.config'),
6726
 
        ('cmd_dpush', [], 'brzlib.foreign'),
6727
 
        ('cmd_version_info', [], 'brzlib.cmd_version_info'),
6728
 
        ('cmd_resolve', ['resolved'], 'brzlib.conflicts'),
6729
 
        ('cmd_conflicts', [], 'brzlib.conflicts'),
6730
 
        ('cmd_ping', [], 'brzlib.smart.ping'),
6731
 
        ('cmd_sign_my_commits', [], 'brzlib.commit_signature_commands'),
6732
 
        ('cmd_verify_signatures', [], 'brzlib.commit_signature_commands'),
6733
 
        ('cmd_test_script', [], 'brzlib.cmd_test_script'),
 
6724
        ('cmd_bundle_info', [], 'breezy.bundle.commands'),
 
6725
        ('cmd_config', [], 'breezy.config'),
 
6726
        ('cmd_dpush', [], 'breezy.foreign'),
 
6727
        ('cmd_version_info', [], 'breezy.cmd_version_info'),
 
6728
        ('cmd_resolve', ['resolved'], 'breezy.conflicts'),
 
6729
        ('cmd_conflicts', [], 'breezy.conflicts'),
 
6730
        ('cmd_ping', [], 'breezy.smart.ping'),
 
6731
        ('cmd_sign_my_commits', [], 'breezy.commit_signature_commands'),
 
6732
        ('cmd_verify_signatures', [], 'breezy.commit_signature_commands'),
 
6733
        ('cmd_test_script', [], 'breezy.cmd_test_script'),
6734
6734
        ]:
6735
6735
        builtin_command_registry.register_lazy(name, aliases, module_name)