/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 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""builtin bzr commands"""
 
17
"""builtin brz commands"""
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
21
import os
22
22
 
23
 
import bzrlib.bzrdir
 
23
import breezy.bzrdir
24
24
 
25
 
from bzrlib 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 bzrlib
33
 
from bzrlib 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 bzrlib.branch import Branch
60
 
from bzrlib.conflicts import ConflictList
61
 
from bzrlib.transport import memory
62
 
from bzrlib.revisionspec import RevisionSpec, RevisionInfo
63
 
from bzrlib.smtp_connection import SMTPConnection
64
 
from bzrlib.workingtree import WorkingTree
65
 
from bzrlib.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 bzrlib.commands import (
 
68
from breezy.commands import (
69
69
    Command,
70
70
    builtin_command_registry,
71
71
    display_command,
72
72
    )
73
 
from bzrlib.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 bzrlib.trace import mutter, note, warning, is_quiet, get_verbosity_level
81
 
from bzrlib 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
 
257
257
        return None
258
258
    if len(revisions) != 1:
259
259
        raise errors.BzrCommandError(gettext(
260
 
            'bzr %s --revision takes exactly one revision identifier') % (
 
260
            'brz %s --revision takes exactly one revision identifier') % (
261
261
                command_name,))
262
262
    return revisions[0]
263
263
 
343
343
    character: '/', '@' or '*' respectively. These decorations can be
344
344
    disabled using the '--no-classify' option.
345
345
 
346
 
    To see ignored files use 'bzr ignored'.  For details on the
347
 
    changes to file texts, use 'bzr diff'.
 
346
    To see ignored files use 'brz ignored'.  For details on the
 
347
    changes to file texts, use 'brz diff'.
348
348
 
349
349
    Note that --short or -S gives status flags for each item, similar
350
350
    to Subversion's status command. To get output similar to svn -q,
351
 
    use bzr status -SV.
 
351
    use brz status -SV.
352
352
 
353
353
    If no arguments are specified, the status of the entire working
354
354
    directory is shown.  Otherwise, only the status of the specified
365
365
 
366
366
    To see which files have changed in a specific revision, or between
367
367
    two revisions, pass a revision range to the revision argument.
368
 
    This will produce the same results as calling 'bzr diff --summarize'.
 
368
    This will produce the same results as calling 'brz diff --summarize'.
369
369
    """
370
370
 
371
371
    # TODO: --no-recurse/-N, --recurse options
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 bzrlib.status import show_tree_status
 
394
        from breezy.status import show_tree_status
395
395
 
396
396
        if revision and len(revision) > 2:
397
 
            raise errors.BzrCommandError(gettext('bzr status --revision takes exactly'
 
397
            raise errors.BzrCommandError(gettext('brz status --revision takes exactly'
398
398
                                         ' one or two revision specifiers'))
399
399
 
400
400
        tree, relfile_list = WorkingTree.open_containing_paths(file_list)
563
563
    Since a lightweight checkout is little more than a working tree
564
564
    this will refuse to run against one.
565
565
 
566
 
    To re-create the working tree, use "bzr checkout".
 
566
    To re-create the working tree, use "brz checkout".
567
567
    """
568
568
    _see_also = ['checkout', 'working-trees']
569
569
    takes_args = ['location*']
608
608
    'known good' state. Any new modifications (adding a file, renaming, etc)
609
609
    will be lost, though modified files will still be detected as such.
610
610
 
611
 
    Most users will want something more like "bzr revert" or "bzr update"
 
611
    Most users will want something more like "brz revert" or "brz update"
612
612
    unless the state file has become corrupted.
613
613
 
614
614
    By default this attempts to recover the current state by looking at the
635
635
                # Refuse
636
636
                raise errors.BzrCommandError(gettext(
637
637
                    'The tree does not appear to be corrupt. You probably'
638
 
                    ' want "bzr revert" instead. Use "--force" if you are'
 
638
                    ' want "brz revert" instead. Use "--force" if you are'
639
639
                    ' sure you want to reset the working tree.'))
640
640
        if revision is None:
641
641
            revision_ids = None
774
774
    A warning will be printed when nested trees are encountered,
775
775
    unless they are explicitly ignored.
776
776
 
777
 
    Therefore simply saying 'bzr add' will version all files that
 
777
    Therefore simply saying 'brz add' will version all files that
778
778
    are currently unknown.
779
779
 
780
780
    Adding a file whose parent directory is not versioned will
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 bzrlib.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 = bzrlib.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 = bzrlib.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:
919
919
    type using the --kind option.  For example: --kind file.
920
920
 
921
921
    It is also possible to restrict the list of files to a specific
922
 
    set. For example: bzr inventory --show-ids this/file
 
922
    set. For example: brz inventory --show-ids this/file
923
923
    """
924
924
 
925
925
    hidden = True
976
976
    __doc__ = """Move or rename a file.
977
977
 
978
978
    :Usage:
979
 
        bzr mv OLDNAME NEWNAME
 
979
        brz mv OLDNAME NEWNAME
980
980
 
981
 
        bzr mv SOURCE... DESTINATION
 
981
        brz mv SOURCE... DESTINATION
982
982
 
983
983
    If the last argument is a versioned directory, all the other names
984
984
    are moved into it.  Otherwise, there must be exactly two arguments
994
994
    """
995
995
 
996
996
    takes_args = ['names*']
997
 
    takes_options = [Option("after", help="Move only the bzr identifier"
 
997
    takes_options = [Option("after", help="Move only the brz identifier"
998
998
        " of the file, because the file has already been moved."),
999
999
        Option('auto', help='Automatically guess renames.'),
1000
1000
        Option('dry-run', help='Avoid making changes when guessing renames.'),
1118
1118
    commit is one that has not been merged (directly or indirectly) into the 
1119
1119
    parent.
1120
1120
 
1121
 
    If branches have diverged, you can use 'bzr merge' to integrate the changes
 
1121
    If branches have diverged, you can use 'brz merge' to integrate the changes
1122
1122
    from one into the other.  Once one branch has merged, the other should
1123
1123
    be able to pull it again.
1124
1124
 
1137
1137
 
1138
1138
    Note: The location can be specified either in the form of a branch,
1139
1139
    or in the form of a path to a file containing a merge directive generated
1140
 
    with bzr send.
 
1140
    with brz send.
1141
1141
    """
1142
1142
 
1143
1143
    _see_also = ['push', 'update', 'status-flags', 'send']
1269
1269
    considered diverged if the destination branch's most recent commit is one
1270
1270
    that has not been merged (directly or indirectly) by the source branch.
1271
1271
 
1272
 
    If branches have diverged, you can use 'bzr push --overwrite' to replace
 
1272
    If branches have diverged, you can use 'brz push --overwrite' to replace
1273
1273
    the other branch completely, discarding its unmerged changes.
1274
1274
 
1275
1275
    If you want to ensure you have the different changes in the other branch,
1276
 
    do a merge (see bzr help merge) from the other branch, and commit that.
 
1276
    do a merge (see brz help merge) from the other branch, and commit that.
1277
1277
    After that you will be able to do a push without '--overwrite'.
1278
1278
 
1279
1279
    If there is no default push location set, the first push will set it (use
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 bzrlib.push import _show_push_branch
 
1327
        from breezy.push import _show_push_branch
1328
1328
 
1329
1329
        if overwrite:
1330
1330
            overwrite = ["history", "tags"]
1375
1375
                if parent_loc:
1376
1376
                    raise errors.BzrCommandError(gettext(
1377
1377
                        "No push location known or specified. To push to the "
1378
 
                        "parent branch (at %s), use 'bzr push :parent'." %
 
1378
                        "parent branch (at %s), use 'brz push :parent'." %
1379
1379
                        urlutils.unescape_for_display(parent_loc,
1380
1380
                            self.outf.encoding)))
1381
1381
                else:
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 bzrlib import switch as _mod_switch
1444
 
        from bzrlib.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',
1707
1707
    
1708
1708
    If there are any uncommitted changes in the tree, they will be carried
1709
1709
    across and remain as uncommitted changes after the update.  To discard
1710
 
    these changes, use 'bzr revert'.  The uncommitted changes may conflict
 
1710
    these changes, use 'brz revert'.  The uncommitted changes may conflict
1711
1711
    with the changes brought in by the change in basis revision.
1712
1712
 
1713
 
    If the tree's branch is bound to a master branch, bzr will also update
 
1713
    If the tree's branch is bound to a master branch, brz will also update
1714
1714
    the branch from the master.
1715
1715
 
1716
1716
    You cannot update just a single file or directory, because each Bazaar
1717
1717
    working tree has just a single basis revision.  If you want to restore a
1718
 
    file that has been removed locally, use 'bzr revert' instead of 'bzr
 
1718
    file that has been removed locally, use 'brz revert' instead of 'brz
1719
1719
    update'.  If you want to restore a file to its state in a previous
1720
 
    revision, use 'bzr revert' with a '-r' option, or use 'bzr cat' to write
 
1720
    revision, use 'brz revert' with a '-r' option, or use 'brz cat' to write
1721
1721
    out the old content of that file to a new location.
1722
1722
 
1723
1723
    The 'dir' argument, if given, must be the location of the root of a
1735
1735
 
1736
1736
    def run(self, dir=None, revision=None, show_base=None):
1737
1737
        if revision is not None and len(revision) != 1:
1738
 
            raise errors.BzrCommandError(gettext(
1739
 
                "bzr update --revision takes exactly one revision"))
 
1738
            raise errors.brzCommandError(gettext(
 
1739
                "brz update --revision takes exactly one revision"))
1740
1740
        if dir is None:
1741
1741
            tree = WorkingTree.open_containing('.')[0]
1742
1742
        else:
1744
1744
            if relpath:
1745
1745
                # See bug 557886.
1746
1746
                raise errors.BzrCommandError(gettext(
1747
 
                    "bzr update can only update a whole tree, "
 
1747
                    "brz update can only update a whole tree, "
1748
1748
                    "not a file or subdirectory"))
1749
1749
        branch = tree.branch
1750
1750
        possible_transports = []
1792
1792
        except errors.NoSuchRevision, e:
1793
1793
            raise errors.BzrCommandError(gettext(
1794
1794
                                  "branch has no revision %s\n"
1795
 
                                  "bzr update --revision only works"
 
1795
                                  "brz update --revision only works"
1796
1796
                                  " for a revision in the branch history")
1797
1797
                                  % (e.revision))
1798
1798
        revno = tree.branch.revision_id_to_dotted_revno(
1802
1802
        parent_ids = tree.get_parent_ids()
1803
1803
        if parent_ids[1:] and parent_ids[1:] != existing_pending_merges:
1804
1804
            note(gettext('Your local commits will now show as pending merges with '
1805
 
                 "'bzr status', and can be committed with 'bzr commit'."))
 
1805
                 "'brz status', and can be committed with 'brz commit'."))
1806
1806
        if conflicts != 0:
1807
1807
            return 1
1808
1808
        else:
1825
1825
 
1826
1826
      Display information on the format and related locations:
1827
1827
 
1828
 
        bzr info
 
1828
        brz info
1829
1829
 
1830
1830
      Display the above together with extended format information and
1831
1831
      basic statistics (like the number of files in the working tree and
1832
1832
      number of revisions in the branch and repository):
1833
1833
 
1834
 
        bzr info -v
 
1834
        brz info -v
1835
1835
 
1836
1836
      Display the above together with number of committers to the branch:
1837
1837
 
1838
 
        bzr info -vv
 
1838
        brz info -vv
1839
1839
    """
1840
1840
    _see_also = ['revno', 'working-trees', 'repositories']
1841
1841
    takes_args = ['location?']
1848
1848
            noise_level = get_verbosity_level()
1849
1849
        else:
1850
1850
            noise_level = 0
1851
 
        from bzrlib.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
 
1869
1869
            'The file deletion mode to be used.',
1870
1870
            title='Deletion Strategy', value_switches=True, enum_switch=False,
1871
1871
            safe='Backup changed files (default).',
1872
 
            keep='Delete from bzr but leave the working copy.',
 
1872
            keep='Delete from brz but leave the working copy.',
1873
1873
            no_backup='Don\'t backup changed files.'),
1874
1874
        ]
1875
1875
    aliases = ['rm', 'del']
1952
1952
 
1953
1953
 
1954
1954
class cmd_reconcile(Command):
1955
 
    __doc__ = """Reconcile bzr metadata in a branch.
 
1955
    __doc__ = """Reconcile brz metadata in a branch.
1956
1956
 
1957
1957
    This can correct data mismatches that may have been caused by
1958
 
    previous ghost operations or bzr upgrades. You should only
1959
 
    need to run this command if 'bzr check' or a bzr developer
 
1958
    previous ghost operations or brz upgrades. You should only
 
1959
    need to run this command if 'brz check' or a brz developer
1960
1960
    advises you to run it.
1961
1961
 
1962
1962
    If a second branch is provided, cross-branch reconciliation is
1963
1963
    also attempted, which will check that data like the tree root
1964
 
    id which was not present in very early bzr versions is represented
 
1964
    id which was not present in very early brz versions is represented
1965
1965
    correctly in both branches.
1966
1966
 
1967
1967
    At the same time it is run it may recompress data resulting in
1980
1980
        ]
1981
1981
 
1982
1982
    def run(self, branch=".", canonicalize_chks=False):
1983
 
        from bzrlib.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
 
2046
2046
    in the .bzr directory.
2047
2047
 
2048
2048
    If there is already a branch at the location but it has no working tree,
2049
 
    the tree can be populated with 'bzr checkout'.
 
2049
    the tree can be populated with 'brz checkout'.
2050
2050
 
2051
2051
    Recipe for importing a tree of files::
2052
2052
 
2053
2053
        cd ~/project
2054
 
        bzr init
2055
 
        bzr add .
2056
 
        bzr status
2057
 
        bzr commit -m "imported project"
 
2054
        brz init
 
2055
        brz add .
 
2056
        brz status
 
2057
        brz commit -m "imported project"
2058
2058
    """
2059
2059
 
2060
2060
    _see_also = ['init-repository', 'branch', 'checkout']
2066
2066
         RegistryOption('format',
2067
2067
                help='Specify a format for this branch. '
2068
2068
                'See "help formats".',
2069
 
                lazy_registry=('bzrlib.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 bzrlib.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 bzrlib.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):
2170
2170
    :Examples:
2171
2171
        Create a shared repository holding just branches::
2172
2172
 
2173
 
            bzr init-repo --no-trees repo
2174
 
            bzr init repo/trunk
 
2173
            brz init-repo --no-trees repo
 
2174
            brz init repo/trunk
2175
2175
 
2176
2176
        Make a lightweight checkout elsewhere::
2177
2177
 
2178
 
            bzr checkout --lightweight repo/trunk trunk-checkout
 
2178
            brz checkout --lightweight repo/trunk trunk-checkout
2179
2179
            cd trunk-checkout
2180
2180
            (add files here)
2181
2181
    """
2184
2184
    takes_args = ["location"]
2185
2185
    takes_options = [RegistryOption('format',
2186
2186
                            help='Specify a format for this repository. See'
2187
 
                                 ' "bzr help formats" for details.',
2188
 
                            lazy_registry=('bzrlib.controldir', 'format_registry'),
 
2187
                                 ' "brz help formats" for details.',
 
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 bzrlib.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
 
2224
2224
    the first argument, if any, or the current tree if no arguments are
2225
2225
    given.
2226
2226
 
2227
 
    "bzr diff -p1" is equivalent to "bzr diff --prefix old/:new/", and
 
2227
    "brz diff -p1" is equivalent to "brz diff --prefix old/:new/", and
2228
2228
    produces patches suitable for "patch -p1".
2229
2229
 
2230
2230
    Note that when using the -r argument with a range of revisions, the
2231
2231
    differences are computed between the two specified revisions.  That
2232
2232
    is, the command does not show the changes introduced by the first 
2233
2233
    revision in the range.  This differs from the interpretation of 
2234
 
    revision ranges used by "bzr log" which includes the first revision
 
2234
    revision ranges used by "brz log" which includes the first revision
2235
2235
    in the range.
2236
2236
 
2237
2237
    :Exit values:
2243
2243
    :Examples:
2244
2244
        Shows the difference in the working tree versus the last commit::
2245
2245
 
2246
 
            bzr diff
 
2246
            brz diff
2247
2247
 
2248
2248
        Difference between the working tree and revision 1::
2249
2249
 
2250
 
            bzr diff -r1
 
2250
            brz diff -r1
2251
2251
 
2252
2252
        Difference between revision 3 and revision 1::
2253
2253
 
2254
 
            bzr diff -r1..3
 
2254
            brz diff -r1..3
2255
2255
 
2256
2256
        Difference between revision 3 and revision 1 for branch xxx::
2257
2257
 
2258
 
            bzr diff -r1..3 xxx
 
2258
            brz diff -r1..3 xxx
2259
2259
 
2260
2260
        The changes introduced by revision 2 (equivalent to -r1..2)::
2261
2261
 
2262
 
            bzr diff -c2
 
2262
            brz diff -c2
2263
2263
 
2264
2264
        To see the changes introduced by revision X::
2265
2265
        
2266
 
            bzr diff -cX
 
2266
            brz diff -cX
2267
2267
 
2268
2268
        Note that in the case of a merge, the -c option shows the changes
2269
2269
        compared to the left hand parent. To see the changes against
2270
2270
        another parent, use::
2271
2271
 
2272
 
            bzr diff -r<chosen_parent>..X
 
2272
            brz diff -r<chosen_parent>..X
2273
2273
 
2274
2274
        The changes between the current revision and the previous revision
2275
2275
        (equivalent to -c-1 and -r-2..-1)
2276
2276
 
2277
 
            bzr diff -r-2..
 
2277
            brz diff -r-2..
2278
2278
 
2279
2279
        Show just the differences for file NEWS::
2280
2280
 
2281
 
            bzr diff NEWS
 
2281
            brz diff NEWS
2282
2282
 
2283
2283
        Show the differences in working tree xxx for file NEWS::
2284
2284
 
2285
 
            bzr diff xxx/NEWS
 
2285
            brz diff xxx/NEWS
2286
2286
 
2287
2287
        Show the differences from branch xxx to this working tree:
2288
2288
 
2289
 
            bzr diff --old xxx
 
2289
            brz diff --old xxx
2290
2290
 
2291
2291
        Show the differences between two branches for file NEWS::
2292
2292
 
2293
 
            bzr diff --old xxx --new yyy NEWS
2294
 
 
2295
 
        Same as 'bzr diff' but prefix paths with old/ and new/::
2296
 
 
2297
 
            bzr diff --prefix old/:new/
 
2293
            brz diff --old xxx --new yyy NEWS
 
2294
 
 
2295
        Same as 'brz diff' but prefix paths with old/ and new/::
 
2296
 
 
2297
            brz diff --prefix old/:new/
2298
2298
            
2299
2299
        Show the differences using a custom diff program with options::
2300
2300
        
2301
 
            bzr diff --using /usr/bin/diff --diff-options -wu
 
2301
            brz diff --using /usr/bin/diff --diff-options -wu
2302
2302
    """
2303
2303
    _see_also = ['status']
2304
2304
    takes_args = ['file*']
2326
2326
        RegistryOption('format',
2327
2327
            short_name='F',
2328
2328
            help='Diff format to use.',
2329
 
            lazy_registry=('bzrlib.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 bzrlib.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'):
2358
2358
                ' (eg "old/:new/")'))
2359
2359
 
2360
2360
        if revision and len(revision) > 2:
2361
 
            raise errors.BzrCommandError(gettext('bzr diff --revision takes exactly'
 
2361
            raise errors.BzrCommandError(gettext('brz diff --revision takes exactly'
2362
2362
                                         ' one or two revision specifiers'))
2363
2363
 
2364
2364
        if using is not None and format is not None:
2492
2492
class cmd_log(Command):
2493
2493
    __doc__ = """Show historical log for a branch or subset of a branch.
2494
2494
 
2495
 
    log is bzr's default tool for exploring the history of a branch.
 
2495
    log is brz's default tool for exploring the history of a branch.
2496
2496
    The branch to use is taken from the first parameter. If no parameters
2497
2497
    are given, the branch containing the working directory is logged.
2498
2498
    Here are some simple examples::
2499
2499
 
2500
 
      bzr log                       log the current branch
2501
 
      bzr log foo.py                log a file in its branch
2502
 
      bzr log http://server/branch  log a branch on a server
 
2500
      brz log                       log the current branch
 
2501
      brz log foo.py                log a file in its branch
 
2502
      brz log http://server/branch  log a branch on a server
2503
2503
 
2504
2504
    The filtering, ordering and information shown for each revision can
2505
2505
    be controlled as explained below. By default, all revisions are
2512
2512
 
2513
2513
      The log format controls how information about each revision is
2514
2514
      displayed. The standard log formats are called ``long``, ``short``
2515
 
      and ``line``. The default is long. See ``bzr help log-formats``
 
2515
      and ``line``. The default is long. See ``brz help log-formats``
2516
2516
      for more details on log formats.
2517
2517
 
2518
2518
      The following options can be used to control what information is
2549
2549
        -r..Y    display up to and including revision Y
2550
2550
        -rX..Y   display from X to Y inclusive
2551
2551
 
2552
 
      See ``bzr help revisionspec`` for details on how to specify X and Y.
 
2552
      See ``brz help revisionspec`` for details on how to specify X and Y.
2553
2553
      Some common examples are given below::
2554
2554
 
2555
2555
        -r-1                show just the tip
2585
2585
 
2586
2586
      In this case:
2587
2587
 
2588
 
      * ``bzr log guide.txt`` will log the file added in revision 1
2589
 
 
2590
 
      * ``bzr log tutorial.txt`` will log the new file added in revision 3
2591
 
 
2592
 
      * ``bzr log -r2 -p tutorial.txt`` will show the changes made to
 
2588
      * ``brz log guide.txt`` will log the file added in revision 1
 
2589
 
 
2590
      * ``brz log tutorial.txt`` will log the new file added in revision 3
 
2591
 
 
2592
      * ``brz log -r2 -p tutorial.txt`` will show the changes made to
2593
2593
        the original file in revision 2.
2594
2594
 
2595
 
      * ``bzr log -r2 -p guide.txt`` will display an error message as there
 
2595
      * ``brz log -r2 -p guide.txt`` will display an error message as there
2596
2596
        was no file called guide.txt in revision 2.
2597
2597
 
2598
2598
      Renames are always followed by log. By design, there is no need to
2611
2611
 
2612
2612
      GUI tools and IDEs are often better at exploring history than command
2613
2613
      line tools: you may prefer qlog or viz from qbzr or bzr-gtk, the
2614
 
      bzr-explorer shell, or the Loggerhead web interface.  See the Plugin
2615
 
      Guide <http://doc.bazaar.canonical.com/plugins/en/> and
 
2614
      bzr-explorer shell, or the Loggerhead web interface.  See the Bazaar
 
2615
      Plugin Guide <http://doc.bazaar.canonical.com/plugins/en/> and
2616
2616
      <http://wiki.bazaar.canonical.com/IDEIntegration>.  
2617
2617
 
2618
2618
      You may find it useful to add the aliases below to ``bazaar.conf``::
2622
2622
        top = log -l10 --line
2623
2623
        show = log -v -p
2624
2624
 
2625
 
      ``bzr tip`` will then show the latest revision while ``bzr top``
 
2625
      ``brz tip`` will then show the latest revision while ``brz top``
2626
2626
      will show the last 10 mainline revisions. To see the details of a
2627
 
      particular revision X,  ``bzr show -rX``.
 
2627
      particular revision X,  ``brz show -rX``.
2628
2628
 
2629
2629
      If you are interested in looking deeper into a particular merge X,
2630
 
      use ``bzr log -n0 -rX``.
 
2630
      use ``brz log -n0 -rX``.
2631
2631
 
2632
 
      ``bzr log -v`` on a branch with lots of history is currently
 
2632
      ``brz log -v`` on a branch with lots of history is currently
2633
2633
      very slow. A fix for this issue is currently under development.
2634
2634
      With or without that fix, it is recommended that a revision range
2635
2635
      be given when using the -v option.
2636
2636
 
2637
 
      bzr has a generic full-text matching plugin, bzr-search, that can be
 
2637
      brz has a generic full-text matching plugin, brz-search, that can be
2638
2638
      used to find revisions matching user names, commit messages, etc.
2639
2639
      Among other features, this plugin can find all revisions containing
2640
2640
      a list of words but not others.
2655
2655
            'show-ids',
2656
2656
            'revision',
2657
2657
            Option('change',
2658
 
                   type=bzrlib.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=('bzrlib.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 bzrlib.log import (
 
2746
        from breezy.log import (
2747
2747
            Logger,
2748
2748
            make_log_request_dict,
2749
2749
            _get_info_for_log_files,
2912
2912
            # show_log will use its revision_history. Having
2913
2913
            # different branches will lead to weird behaviors.
2914
2914
            raise errors.BzrCommandError(gettext(
2915
 
                "bzr %s doesn't accept two revisions in different"
 
2915
                "brz %s doesn't accept two revisions in different"
2916
2916
                " branches.") % command_name)
2917
2917
        if start_spec.spec is None:
2918
2918
            # Avoid loading all the history.
2928
2928
            rev2 = end_spec.in_history(branch)
2929
2929
    else:
2930
2930
        raise errors.BzrCommandError(gettext(
2931
 
            'bzr %s --revision takes one or two values.') % command_name)
 
2931
            'brz %s --revision takes one or two values.') % command_name)
2932
2932
    return rev1, rev2
2933
2933
 
2934
2934
 
2955
2955
class cmd_touching_revisions(Command):
2956
2956
    __doc__ = """Return revision-ids which affected a particular file.
2957
2957
 
2958
 
    A more user-friendly interface is "bzr log FILE".
 
2958
    A more user-friendly interface is "brz log FILE".
2959
2959
    """
2960
2960
 
2961
2961
    hidden = True
3106
3106
class cmd_ignore(Command):
3107
3107
    __doc__ = """Ignore specified files or patterns.
3108
3108
 
3109
 
    See ``bzr help patterns`` for details on the syntax of patterns.
 
3109
    See ``brz help patterns`` for details on the syntax of patterns.
3110
3110
 
3111
3111
    If a .bzrignore file does not exist, the ignore command
3112
3112
    will create one and add the specified files or patterns to the newly
3143
3143
    :Examples:
3144
3144
        Ignore the top level Makefile::
3145
3145
 
3146
 
            bzr ignore ./Makefile
 
3146
            brz ignore ./Makefile
3147
3147
 
3148
3148
        Ignore .class files in all directories...::
3149
3149
 
3150
 
            bzr ignore "*.class"
 
3150
            brz ignore "*.class"
3151
3151
 
3152
3152
        ...but do not ignore "special.class"::
3153
3153
 
3154
 
            bzr ignore "!special.class"
 
3154
            brz ignore "!special.class"
3155
3155
 
3156
3156
        Ignore files whose name begins with the "#" character::
3157
3157
 
3158
 
            bzr ignore "RE:^#"
3159
 
 
3160
 
        Ignore .o files under the lib directory::
3161
 
 
3162
 
            bzr ignore "lib/**/*.o"
3163
 
 
3164
 
        Ignore .o files under the lib directory::
3165
 
 
3166
 
            bzr ignore "RE:lib/.*\.o"
 
3158
            brz ignore "RE:^#"
 
3159
 
 
3160
        Ignore .o files under the lib directory::
 
3161
 
 
3162
            brz ignore "lib/**/*.o"
 
3163
 
 
3164
        Ignore .o files under the lib directory::
 
3165
 
 
3166
            brz ignore "RE:lib/.*\.o"
3167
3167
 
3168
3168
        Ignore everything but the "debian" toplevel directory::
3169
3169
 
3170
 
            bzr ignore "RE:(?!debian/).*"
 
3170
            brz ignore "RE:(?!debian/).*"
3171
3171
        
3172
3172
        Ignore everything except the "local" toplevel directory,
3173
3173
        but always ignore autosave files ending in ~, even under local/::
3174
3174
        
3175
 
            bzr ignore "*"
3176
 
            bzr ignore "!./local"
3177
 
            bzr ignore "!!*~"
 
3175
            brz ignore "*"
 
3176
            brz ignore "!./local"
 
3177
            brz ignore "!!*~"
3178
3178
    """
3179
3179
 
3180
3180
    _see_also = ['status', 'ignored', 'patterns']
3181
3181
    takes_args = ['name_pattern*']
3182
3182
    takes_options = ['directory',
3183
3183
        Option('default-rules',
3184
 
               help='Display the default ignore rules that bzr uses.')
 
3184
               help='Display the default ignore rules that brz uses.')
3185
3185
        ]
3186
3186
 
3187
3187
    def run(self, name_pattern_list=None, default_rules=None,
3188
3188
            directory=u'.'):
3189
 
        from bzrlib 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:
3229
3229
            self.outf.write(gettext("Warning: the following files are version "
3230
3230
                  "controlled and match your ignore pattern:\n%s"
3231
3231
                  "\nThese files will continue to be version controlled"
3232
 
                  " unless you 'bzr remove' them.\n") % ("\n".join(matches),))
 
3232
                  " unless you 'brz remove' them.\n") % ("\n".join(matches),))
3233
3233
 
3234
3234
 
3235
3235
class cmd_ignored(Command):
3240
3240
 
3241
3241
    Alternatively, to list just the files::
3242
3242
 
3243
 
        bzr ls --ignored
 
3243
        brz ls --ignored
3244
3244
    """
3245
3245
 
3246
3246
    encoding_type = 'replace'
3263
3263
    __doc__ = """Lookup the revision-id from a revision-number
3264
3264
 
3265
3265
    :Examples:
3266
 
        bzr lookup-revision 33
 
3266
        brz lookup-revision 33
3267
3267
    """
3268
3268
    hidden = True
3269
3269
    takes_args = ['revno']
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 bzrlib.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
3378
3378
    def run(self, filename, revision=None, name_from_revision=False,
3379
3379
            filters=False, directory=None):
3380
3380
        if revision is not None and len(revision) != 1:
3381
 
            raise errors.BzrCommandError(gettext("bzr cat --revision takes exactly"
 
3381
            raise errors.BzrCommandError(gettext("brz cat --revision takes exactly"
3382
3382
                                         " one revision specifier"))
3383
3383
        tree, branch, relpath = \
3384
3384
            _open_directory_or_containing_tree_or_branch(filename, 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 bzrlib.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)
3461
3461
      For example, to commit only changes within foo, but not changes
3462
3462
      within foo/bar::
3463
3463
  
3464
 
        bzr commit foo -x foo/bar
 
3464
        brz commit foo -x foo/bar
3465
3465
  
3466
3466
      A selective commit after a merge is not yet supported.
3467
3467
 
3479
3479
      A common mistake is to forget to add a new file or directory before
3480
3480
      running the commit command. The --strict option checks for unknown
3481
3481
      files and aborts the commit if any are found. More advanced pre-commit
3482
 
      checks can be implemented by defining hooks. See ``bzr help hooks``
 
3482
      checks can be implemented by defining hooks. See ``brz help hooks``
3483
3483
      for details.
3484
3484
 
3485
3485
    :Things to note:
3486
3486
 
3487
3487
      If you accidentially commit the wrong changes or make a spelling
3488
3488
      mistake in the commit message say, you can use the uncommit command
3489
 
      to undo it. See ``bzr help uncommit`` for details.
 
3489
      to undo it. See ``brz help uncommit`` for details.
3490
3490
 
3491
3491
      Hooks can also be configured to run after a commit. This allows you
3492
3492
      to trigger updates to external systems like bug trackers. The --fixes
3493
3493
      option can be used to record the association between a revision and
3494
 
      one or more bugs. See ``bzr help bugs`` for details.
 
3494
      one or more bugs. See ``brz help bugs`` for details.
3495
3495
    """
3496
3496
 
3497
3497
    _see_also = ['add', 'bugs', 'hooks', 'uncommit']
3517
3517
                    "format, e.g. '2009-10-10 08:00:00 +0100'."),
3518
3518
             ListOption('fixes', type=str,
3519
3519
                    help="Mark a bug as being fixed by this revision "
3520
 
                         "(see \"bzr help bugs\")."),
 
3520
                         "(see \"brz help bugs\")."),
3521
3521
             ListOption('author', type=unicode,
3522
3522
                    help="Set the author's name, if it's different "
3523
3523
                         "from the committer."),
3552
3552
                        "No tracker specified for bug %s. Use the form "
3553
3553
                        "'tracker:id' or specify a default bug tracker "
3554
3554
                        "using the `bugtracker` option.\nSee "
3555
 
                        "\"bzr help bugs\" for more information on this "
 
3555
                        "\"brz help bugs\" for more information on this "
3556
3556
                        "feature. Commit refused.") % fixed_bug)
3557
3557
                tag = default_bugtracker
3558
3558
                bug_id = tokens[0]
3559
3559
            elif len(tokens) != 2:
3560
3560
                raise errors.BzrCommandError(gettext(
3561
3561
                    "Invalid bug %s. Must be in the form of 'tracker:id'. "
3562
 
                    "See \"bzr help bugs\" for more information on this "
 
3562
                    "See \"brz help bugs\" for more information on this "
3563
3563
                    "feature.\nCommit refused.") % fixed_bug)
3564
3564
            else:
3565
3565
                tag, bug_id = tokens
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 bzrlib.errors import (
 
3579
        from breezy.errors import (
3580
3580
            PointlessCommit,
3581
3581
            ConflictsInTree,
3582
3582
            StrictCommitFailed
3583
3583
        )
3584
 
        from bzrlib.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,
3687
3687
                        lossy=lossy)
3688
3688
        except PointlessCommit:
3689
3689
            raise errors.BzrCommandError(gettext("No changes to commit."
3690
 
                " Please 'bzr add' the files you want to commit, or use"
 
3690
                " Please 'brz add' the files you want to commit, or use"
3691
3691
                " --unchanged to force an empty commit."))
3692
3692
        except ConflictsInTree:
3693
3693
            raise errors.BzrCommandError(gettext('Conflicts detected in working '
3694
 
                'tree.  Use "bzr conflicts" to list, "bzr resolve FILE" to'
 
3694
                'tree.  Use "brz conflicts" to list, "brz resolve FILE" to'
3695
3695
                ' resolve.'))
3696
3696
        except StrictCommitFailed:
3697
3697
            raise errors.BzrCommandError(gettext("Commit refused because there are"
3708
3708
    __doc__ = """Validate working tree structure, branch consistency and repository history.
3709
3709
 
3710
3710
    This command checks various invariants about branch and repository storage
3711
 
    to detect data corruption or bzr bugs.
 
3711
    to detect data corruption or brz bugs.
3712
3712
 
3713
3713
    The working tree and branch checks will only give output if a problem is
3714
3714
    detected. The output fields of the repository check are:
3743
3743
 
3744
3744
        Check the tree and branch at 'foo'::
3745
3745
 
3746
 
            bzr check --tree --branch foo
 
3746
            brz check --tree --branch foo
3747
3747
 
3748
3748
        Check only the repository at 'bar'::
3749
3749
 
3750
 
            bzr check --repo bar
 
3750
            brz check --repo bar
3751
3751
 
3752
3752
        Check everything at 'baz'::
3753
3753
 
3754
 
            bzr check baz
 
3754
            brz check baz
3755
3755
    """
3756
3756
 
3757
3757
    _see_also = ['reconcile']
3766
3766
 
3767
3767
    def run(self, path=None, verbose=False, branch=False, repo=False,
3768
3768
            tree=False):
3769
 
        from bzrlib.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:
3811
3811
    takes_args = ['url?']
3812
3812
    takes_options = [
3813
3813
        RegistryOption('format',
3814
 
            help='Upgrade to a specific format.  See "bzr help'
 
3814
            help='Upgrade to a specific format.  See "brz help'
3815
3815
                 ' formats" for details.',
3816
 
            lazy_registry=('bzrlib.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 bzrlib.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:
3834
3834
 
3835
3835
 
3836
3836
class cmd_whoami(Command):
3837
 
    __doc__ = """Show or set bzr user id.
 
3837
    __doc__ = """Show or set brz user id.
3838
3838
 
3839
3839
    :Examples:
3840
3840
        Show the email of the current user::
3841
3841
 
3842
 
            bzr whoami --email
 
3842
            brz whoami --email
3843
3843
 
3844
3844
        Set the current user::
3845
3845
 
3846
 
            bzr whoami "Frank Chu <fchu@example.com>"
 
3846
            brz whoami "Frank Chu <fchu@example.com>"
3847
3847
    """
3848
3848
    takes_options = [ 'directory',
3849
3849
                      Option('email',
3930
3930
    :Examples:
3931
3931
        Show the current aliases::
3932
3932
 
3933
 
            bzr alias
 
3933
            brz alias
3934
3934
 
3935
3935
        Show the alias specified for 'll'::
3936
3936
 
3937
 
            bzr alias ll
 
3937
            brz alias ll
3938
3938
 
3939
3939
        Set an alias for 'll'::
3940
3940
 
3941
 
            bzr alias ll="log --line -r-10..-1"
 
3941
            brz alias ll="log --line -r-10..-1"
3942
3942
 
3943
3943
        To remove an alias for 'll'::
3944
3944
 
3945
 
            bzr alias --remove ll
 
3945
            brz alias --remove ll
3946
3946
 
3947
3947
    """
3948
3948
    takes_args = ['name?']
3965
3965
    def remove_alias(self, alias_name):
3966
3966
        if alias_name is None:
3967
3967
            raise errors.BzrCommandError(gettext(
3968
 
                'bzr alias --remove expects an alias to remove.'))
 
3968
                'brz alias --remove expects an alias to remove.'))
3969
3969
        # If alias is not found, print something like:
3970
3970
        # unalias: foo: not found
3971
3971
        c = _mod_config.GlobalConfig()
3976
3976
        """Print out the defined aliases in a similar format to bash."""
3977
3977
        aliases = _mod_config.GlobalConfig().get_aliases()
3978
3978
        for key, value in sorted(aliases.iteritems()):
3979
 
            self.outf.write('bzr alias %s="%s"\n' % (key, value))
 
3979
            self.outf.write('brz alias %s="%s"\n' % (key, value))
3980
3980
 
3981
3981
    @display_command
3982
3982
    def print_alias(self, alias_name):
3983
 
        from bzrlib.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
 
            self.outf.write("bzr alias: %s: not found\n" % alias_name)
 
3986
            self.outf.write("brz alias: %s: not found\n" % alias_name)
3987
3987
        else:
3988
3988
            self.outf.write(
3989
 
                'bzr alias %s="%s"\n' % (alias_name, ' '.join(alias)))
 
3989
                'brz alias %s="%s"\n' % (alias_name, ' '.join(alias)))
3990
3990
 
3991
3991
    def set_alias(self, alias_name, alias_command):
3992
3992
        """Save the alias in the global config."""
4028
4028
    Tests that need working space on disk use a common temporary directory,
4029
4029
    typically inside $TMPDIR or /tmp.
4030
4030
 
4031
 
    If you set BZR_TEST_PDB=1 when running selftest, failing tests will drop
 
4031
    If you set BRZ_TEST_PDB=1 when running selftest, failing tests will drop
4032
4032
    into a pdb postmortem session.
4033
4033
 
4034
4034
    The --coverage=DIRNAME global option produces a report with covered code
4037
4037
    :Examples:
4038
4038
        Run only tests relating to 'ignore'::
4039
4039
 
4040
 
            bzr selftest ignore
 
4040
            brz selftest ignore
4041
4041
 
4042
4042
        Disable plugins and list tests as they're run::
4043
4043
 
4044
 
            bzr --no-plugins selftest -v
 
4044
            brz --no-plugins selftest -v
4045
4045
    """
4046
4046
    # NB: this is used from the class without creating an instance, which is
4047
4047
    # why it does not have a self parameter.
4048
4048
    def get_transport_type(typestring):
4049
4049
        """Parse and return a transport specifier."""
4050
4050
        if typestring == "sftp":
4051
 
            from bzrlib.tests import stub_sftp
 
4051
            from breezy.tests import stub_sftp
4052
4052
            return stub_sftp.SFTPAbsoluteServer
4053
4053
        elif typestring == "memory":
4054
 
            from bzrlib.tests import test_server
 
4054
            from breezy.tests import test_server
4055
4055
            return memory.MemoryServer
4056
4056
        elif typestring == "fakenfs":
4057
 
            from bzrlib.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=('bzrlib.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 bzrlib 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 bzrlib.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."))
4163
4163
                'suite_decorators', []).append(parallel)
4164
4164
        if benchmark:
4165
4165
            raise errors.BzrCommandError(gettext(
4166
 
                "--benchmark is no longer supported from bzr 2.2; "
 
4166
                "--benchmark is no longer supported from brz 2.2; "
4167
4167
                "use bzr-usertest instead"))
4168
4168
        test_suite_factory = None
4169
4169
        if not exclude:
4210
4210
 
4211
4211
 
4212
4212
class cmd_version(Command):
4213
 
    __doc__ = """Show version of bzr."""
 
4213
    __doc__ = """Show version of brz."""
4214
4214
 
4215
4215
    encoding_type = 'replace'
4216
4216
    takes_options = [
4219
4219
 
4220
4220
    @display_command
4221
4221
    def run(self, short=False):
4222
 
        from bzrlib.version import show_version
 
4222
        from breezy.version import show_version
4223
4223
        if short:
4224
 
            self.outf.write(bzrlib.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 bzrlib.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]
4265
4265
 
4266
4266
    The source of the merge can be specified either in the form of a branch,
4267
4267
    or in the form of a path to a file containing a merge directive generated
4268
 
    with bzr send. If neither is specified, the default is the upstream branch
 
4268
    with brz send. If neither is specified, the default is the upstream branch
4269
4269
    or the branch most recently merged using --remember.  The source of the
4270
4270
    merge may also be specified in the form of a path to a file in another
4271
4271
    branch:  in this case, only the modifications to that file are merged into
4272
4272
    the current working tree.
4273
4273
 
4274
 
    When merging from a branch, by default bzr will try to merge in all new
 
4274
    When merging from a branch, by default brz will try to merge in all new
4275
4275
    work from the other branch, automatically determining an appropriate base
4276
4276
    revision.  If this fails, you may need to give an explicit base.
4277
4277
 
4278
 
    To pick a different ending revision, pass "--revision OTHER".  bzr will
 
4278
    To pick a different ending revision, pass "--revision OTHER".  brz will
4279
4279
    try to merge in all new work up to and including revision OTHER.
4280
4280
 
4281
4281
    If you specify two values, "--revision BASE..OTHER", only revisions BASE
4293
4293
    it will mark a conflict.  A conflict means that you need to fix something,
4294
4294
    before you can commit.
4295
4295
 
4296
 
    Use bzr resolve when you have fixed a problem.  See also bzr conflicts.
 
4296
    Use brz resolve when you have fixed a problem.  See also brz conflicts.
4297
4297
 
4298
4298
    If there is no default branch set, the first merge will set it (use
4299
4299
    --no-remember to avoid setting it). After that, you can omit the branch
4301
4301
    only be saved if the remote location can be accessed.
4302
4302
 
4303
4303
    The results of the merge are placed into the destination working
4304
 
    directory, where they can be reviewed (with bzr diff), tested, and then
 
4304
    directory, where they can be reviewed (with brz diff), tested, and then
4305
4305
    committed to record the result of the merge.
4306
4306
 
4307
4307
    merge refuses to run if there are any uncommitted changes, unless
4318
4318
    you to apply each diff hunk and file change, similar to "shelve".
4319
4319
 
4320
4320
    :Examples:
4321
 
        To merge all new revisions from bzr.dev::
4322
 
 
4323
 
            bzr merge ../bzr.dev
4324
 
 
4325
 
        To merge changes up to and including revision 82 from bzr.dev::
4326
 
 
4327
 
            bzr merge -r 82 ../bzr.dev
 
4321
        To merge all new revisions from brz.dev::
 
4322
 
 
4323
            brz merge ../brz.dev
 
4324
 
 
4325
        To merge changes up to and including revision 82 from brz.dev::
 
4326
 
 
4327
            brz merge -r 82 ../brz.dev
4328
4328
 
4329
4329
        To merge the changes introduced by 82, without previous changes::
4330
4330
 
4331
 
            bzr merge -r 81..82 ../bzr.dev
 
4331
            brz merge -r 81..82 ../brz.dev
4332
4332
 
4333
4333
        To apply a merge directive contained in /tmp/merge::
4334
4334
 
4335
 
            bzr merge /tmp/merge
 
4335
            brz merge /tmp/merge
4336
4336
 
4337
4337
        To create a merge revision with three parents from two branches
4338
4338
        feature1a and feature1b:
4339
4339
 
4340
 
            bzr merge ../feature1a
4341
 
            bzr merge ../feature1b --force
4342
 
            bzr commit -m 'revision with three parents'
 
4340
            brz merge ../feature1a
 
4341
            brz merge ../feature1b --force
 
4342
            brz commit -m 'revision with three parents'
4343
4343
    """
4344
4344
 
4345
4345
    encoding_type = 'exact'
4461
4461
        if merger.this_basis is None:
4462
4462
            raise errors.BzrCommandError(gettext(
4463
4463
                "This branch has no commits."
4464
 
                " (perhaps you would prefer 'bzr pull')"))
 
4464
                " (perhaps you would prefer 'brz pull')"))
4465
4465
        if preview:
4466
4466
            return self._do_preview(merger)
4467
4467
        elif interactive:
4478
4478
        return result_tree
4479
4479
 
4480
4480
    def _do_preview(self, merger):
4481
 
        from bzrlib.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 bzrlib import shelf_ui
 
4507
        from breezy import shelf_ui
4508
4508
        result_tree = self._get_preview(merger)
4509
 
        writer = bzrlib.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 bzrlib.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)
4664
4664
        Re-do the merge of all conflicted files, and show the base text in
4665
4665
        conflict regions, in addition to the usual THIS and OTHER texts::
4666
4666
 
4667
 
            bzr remerge --show-base
 
4667
            brz remerge --show-base
4668
4668
 
4669
4669
        Re-do the merge of "foobar", using the weave merge algorithm, with
4670
4670
        additional processing to reduce the size of conflict regions::
4671
4671
 
4672
 
            bzr remerge --merge-type weave --reprocess foobar
 
4672
            brz remerge --merge-type weave --reprocess foobar
4673
4673
    """
4674
4674
    takes_args = ['file*']
4675
4675
    takes_options = [
4681
4681
 
4682
4682
    def run(self, file_list=None, merge_type=None, show_base=False,
4683
4683
            reprocess=False):
4684
 
        from bzrlib.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)
4782
4782
    not yet committed. These revisions will be included as additional parents
4783
4783
    of the next commit.  Normally, using revert clears that list as well as
4784
4784
    reverting the files.  If any files are specified, revert leaves the list
4785
 
    of uncommitted merges alone and reverts only the files.  Use ``bzr revert
 
4785
    of uncommitted merges alone and reverts only the files.  Use ``brz revert
4786
4786
    .`` in the tree root to revert all files but keep the recorded merges,
4787
 
    and ``bzr revert --forget-merges`` to clear the pending merge list without
 
4787
    and ``brz revert --forget-merges`` to clear the pending merge list without
4788
4788
    reverting any files.
4789
4789
 
4790
 
    Using "bzr revert --forget-merges", it is possible to apply all of the
 
4790
    Using "brz revert --forget-merges", it is possible to apply all of the
4791
4791
    changes from a branch in a single revision.  To do this, perform the merge
4792
4792
    as desired.  Then doing revert with the "--forget-merges" option will keep
4793
4793
    the content of the tree as it was, but it will clear the list of pending
4846
4846
 
4847
4847
    @display_command
4848
4848
    def run(self, topic=None, long=False):
4849
 
        import bzrlib.help
 
4849
        import breezy.help
4850
4850
        if topic is None and long:
4851
4851
            topic = "commands"
4852
 
        bzrlib.help.help(topic)
 
4852
        breezy.help.help(topic)
4853
4853
 
4854
4854
 
4855
4855
class cmd_shell_complete(Command):
4856
4856
    __doc__ = """Show appropriate completions for context.
4857
4857
 
4858
 
    For a list of all available commands, say 'bzr shell-complete'.
 
4858
    For a list of all available commands, say 'brz shell-complete'.
4859
4859
    """
4860
4860
    takes_args = ['context?']
4861
4861
    aliases = ['s-c']
4863
4863
 
4864
4864
    @display_command
4865
4865
    def run(self, context=None):
4866
 
        from bzrlib import shellcomplete
 
4866
        from breezy import shellcomplete
4867
4867
        shellcomplete.shellcomplete(context)
4868
4868
 
4869
4869
 
4885
4885
        Determine the missing revisions between this and the branch at the
4886
4886
        remembered pull location::
4887
4887
 
4888
 
            bzr missing
 
4888
            brz missing
4889
4889
 
4890
4890
        Determine the missing revisions between this and another branch::
4891
4891
 
4892
 
            bzr missing http://server/branch
 
4892
            brz missing http://server/branch
4893
4893
 
4894
4894
        Determine the missing revisions up to a specific revision on the other
4895
4895
        branch::
4896
4896
 
4897
 
            bzr missing -r ..-10
 
4897
            brz missing -r ..-10
4898
4898
 
4899
4899
        Determine the missing revisions up to a specific revision on this
4900
4900
        branch::
4901
4901
 
4902
 
            bzr missing --my-revision ..-10
 
4902
            brz missing --my-revision ..-10
4903
4903
    """
4904
4904
 
4905
4905
    _see_also = ['merge', 'pull']
4938
4938
            include_merged=None, revision=None, my_revision=None,
4939
4939
            directory=u'.',
4940
4940
            include_merges=symbol_versioning.DEPRECATED_PARAMETER):
4941
 
        from bzrlib.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 bzrlib 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 bzrlib.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 bzrlib.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 bzrlib.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()
5349
5349
    remove anything.
5350
5350
 
5351
5351
    If --revision is specified, uncommit revisions to leave the branch at the
5352
 
    specified revision.  For example, "bzr uncommit -r 15" will leave the
 
5352
    specified revision.  For example, "brz uncommit -r 15" will leave the
5353
5353
    branch at revision 15.
5354
5354
 
5355
5355
    Uncommit leaves the working tree ready for a new commit.  The only change
5397
5397
 
5398
5398
    def _run(self, b, tree, dry_run, verbose, revision, force, local,
5399
5399
             keep_tags):
5400
 
        from bzrlib.log import log_formatter, show_log
5401
 
        from bzrlib.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
 
5407
5407
            revno = last_revno
5408
5408
            rev_id = last_rev_id
5409
5409
        else:
5410
 
            # 'bzr uncommit -r 10' actually means uncommit
 
5410
            # 'brz uncommit -r 10' actually means uncommit
5411
5411
            # so that the final tree is at revno 10.
5412
 
            # but bzrlib.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
 
                    'bzrlib.builtins.uncommit',
 
5443
                    'breezy.builtins.uncommit',
5444
5444
                    {}):
5445
5445
                self.outf.write(gettext('Canceled\n'))
5446
5446
                return 0
5450
5450
        uncommit(b, tree=tree, dry_run=dry_run, verbose=verbose,
5451
5451
                 revno=revno, local=local, keep_tags=keep_tags)
5452
5452
        self.outf.write(gettext('You can restore the old tip by running:\n'
5453
 
             '  bzr pull . -r revid:%s\n') % last_rev_id)
 
5453
             '  brz pull . -r revid:%s\n') % last_rev_id)
5454
5454
 
5455
5455
 
5456
5456
class cmd_break_lock(Command):
5462
5462
    CAUTION: Locks should only be broken when you are sure that the process
5463
5463
    holding the lock has been stopped.
5464
5464
 
5465
 
    You can get information on what locks are open via the 'bzr info
 
5465
    You can get information on what locks are open via the 'brz info
5466
5466
    [location]' command.
5467
5467
 
5468
5468
    :Examples:
5469
 
        bzr break-lock
5470
 
        bzr break-lock bzr+ssh://example.com/bzr/foo
5471
 
        bzr break-lock --conf ~/.bazaar
 
5469
        brz break-lock
 
5470
        brz break-lock brz+ssh://example.com/brz/foo
 
5471
        brz break-lock --conf ~/.bazaar
5472
5472
    """
5473
5473
 
5474
5474
    takes_args = ['location?']
5485
5485
        if force:
5486
5486
            ui.ui_factory = ui.ConfirmationUserInterfacePolicy(ui.ui_factory,
5487
5487
                None,
5488
 
                {'bzrlib.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()
5498
5498
 
5499
5499
 
5500
5500
class cmd_wait_until_signalled(Command):
5501
 
    __doc__ = """Test helper for test_start_and_stop_bzr_subprocess_send_signal.
 
5501
    __doc__ = """Test helper for test_start_and_stop_brz_subprocess_send_signal.
5502
5502
 
5503
5503
    This just prints a line to signal when it is ready, then blocks on stdin.
5504
5504
    """
5512
5512
 
5513
5513
 
5514
5514
class cmd_serve(Command):
5515
 
    __doc__ = """Run the bzr server."""
 
5515
    __doc__ = """Run the brz server."""
5516
5516
 
5517
5517
    aliases = ['server']
5518
5518
 
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=('bzrlib.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),
5535
5535
        Option('allow-writes',
5536
5536
               help='By default the server is a readonly server.  Supplying '
5537
5537
                    '--allow-writes enables write access to the contents of '
5538
 
                    'the served directory and below.  Note that ``bzr serve`` '
 
5538
                    'the served directory and below.  Note that ``brz serve`` '
5539
5539
                    'does not perform authentication, so unless some form of '
5540
5540
                    'external authentication is arranged supplying this '
5541
5541
                    'option leads to global uncontrolled write access to your '
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 bzrlib import transport
 
5550
        from breezy import transport
5551
5551
        if directory is None:
5552
5552
            directory = os.getcwd()
5553
5553
        if protocol is None:
5565
5565
    This command requires the target tree to be in a rich-root format.
5566
5566
 
5567
5567
    The TREE argument should be an independent tree, inside another tree, but
5568
 
    not part of it.  (Such trees can be produced by "bzr split", but also by
5569
 
    running "bzr branch" with the target inside a tree.)
 
5568
    not part of it.  (Such trees can be produced by "brz split", but also by
 
5569
    running "brz branch" with the target inside a tree.)
5570
5570
 
5571
5571
    The result is a combined tree, with the subtree no longer an independent
5572
5572
    part.  This is marked as a merge of the subtree into the containing tree,
5587
5587
        if not repo.supports_rich_root():
5588
5588
            raise errors.BzrCommandError(gettext(
5589
5589
                "Can't join trees because %s doesn't support rich root data.\n"
5590
 
                "You can use bzr upgrade on the repository.")
 
5590
                "You can use brz upgrade on the repository.")
5591
5591
                % (repo,))
5592
5592
        if reference:
5593
5593
            try:
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 bzrlib.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),
5706
5706
        base_revision_id = None
5707
5707
        if revision is not None:
5708
5708
            if len(revision) > 2:
5709
 
                raise errors.BzrCommandError(gettext('bzr merge-directive takes '
 
5709
                raise errors.BzrCommandError(gettext('brz merge-directive takes '
5710
5710
                    'at most two one revision identifiers'))
5711
5711
            revision_id = revision[-1].as_revision_id(branch)
5712
5712
            if len(revision) == 2:
5746
5746
      directly from the merge directive, without retrieving data from a
5747
5747
      branch.
5748
5748
 
5749
 
    `bzr send` creates a compact data set that, when applied using bzr
 
5749
    `brz send` creates a compact data set that, when applied using brz
5750
5750
    merge, has the same effect as merging from the source branch.  
5751
5751
    
5752
5752
    By default the merge directive is self-contained and can be applied to any
5771
5771
    omit the location to use the default.  To change the default, use
5772
5772
    --remember. The value will only be saved if the location can be accessed.
5773
5773
 
5774
 
    In order to calculate those changes, bzr must analyse the submit branch.
 
5774
    In order to calculate those changes, brz must analyse the submit branch.
5775
5775
    Therefore it is most efficient for the submit branch to be a local mirror.
5776
5776
    If a public location is known for the submit_branch, that location is used
5777
5777
    in the merge directive.
5801
5801
    default.  "0.9" uses revision bundle format 0.9 and merge directive
5802
5802
    format 1.  It is compatible with Bazaar 0.12 - 0.18.
5803
5803
 
5804
 
    The merge directives created by bzr send may be applied using bzr merge or
5805
 
    bzr pull by specifying a file containing a merge directive as the location.
 
5804
    The merge directives created by brz send may be applied using brz merge or
 
5805
    brz pull by specifying a file containing a merge directive as the location.
5806
5806
 
5807
 
    bzr send makes extensive use of public locations to map local locations into
5808
 
    URLs that can be used by other people.  See `bzr help configuration` to
5809
 
    set them, and use `bzr info` to display them.
 
5807
    brz send makes extensive use of public locations to map local locations into
 
5808
    URLs that can be used by other people.  See `brz help configuration` to
 
5809
    set them, and use `brz info` to display them.
5810
5810
    """
5811
5811
 
5812
5812
    encoding_type = 'exact'
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=('bzrlib.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 bzrlib.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=('bzrlib.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 bzrlib.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,
5942
5942
    It is an error to give a tag name that already exists unless you pass
5943
5943
    --force, in which case the tag is moved to point to the new revision.
5944
5944
 
5945
 
    To rename a tag (change the name but keep it on the same revsion), run ``bzr
5946
 
    tag new-name -r tag:old-name`` and then ``bzr tag --delete oldname``.
 
5945
    To rename a tag (change the name but keep it on the same revsion), run ``brz
 
5946
    tag new-name -r tag:old-name`` and then ``brz tag --delete oldname``.
5947
5947
 
5948
5948
    If no tag name is specified it will be determined through the 
5949
5949
    'automatic_tag_name' hook. This can e.g. be used to automatically tag
5950
 
    upstream releases by reading configure.ac. See ``bzr help hooks`` for
 
5950
    upstream releases by reading configure.ac. See ``brz help hooks`` for
5951
5951
    details.
5952
5952
    """
5953
5953
 
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=('bzrlib.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 bzrlib.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()
6088
6088
 
6089
6089
 
6090
6090
class cmd_reconfigure(Command):
6091
 
    __doc__ = """Reconfigure the type of a bzr directory.
 
6091
    __doc__ = """Reconfigure the type of a brz directory.
6092
6092
 
6093
6093
    A target configuration must be specified.
6094
6094
 
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 bzrlib import switch
 
6242
        from breezy import switch
6243
6243
        tree_location = directory
6244
6244
        revision = _get_one_revision('switch', revision)
6245
6245
        possible_transports = []
6308
6308
    :Examples:
6309
6309
      To define the current view::
6310
6310
 
6311
 
        bzr view file1 dir1 ...
 
6311
        brz view file1 dir1 ...
6312
6312
 
6313
6313
      To list the current view::
6314
6314
 
6315
 
        bzr view
 
6315
        brz view
6316
6316
 
6317
6317
      To delete the current view::
6318
6318
 
6319
 
        bzr view --delete
 
6319
        brz view --delete
6320
6320
 
6321
6321
      To disable the current view without deleting it::
6322
6322
 
6323
 
        bzr view --switch off
 
6323
        brz view --switch off
6324
6324
 
6325
6325
      To define a named view and switch to it::
6326
6326
 
6327
 
        bzr view --name view-name file1 dir1 ...
 
6327
        brz view --name view-name file1 dir1 ...
6328
6328
 
6329
6329
      To list a named view::
6330
6330
 
6331
 
        bzr view --name view-name
 
6331
        brz view --name view-name
6332
6332
 
6333
6333
      To delete a named view::
6334
6334
 
6335
 
        bzr view --name view-name --delete
 
6335
        brz view --name view-name --delete
6336
6336
 
6337
6337
      To switch to a named view::
6338
6338
 
6339
 
        bzr view --switch view-name
 
6339
        brz view --switch view-name
6340
6340
 
6341
6341
      To list all views defined::
6342
6342
 
6343
 
        bzr view --all
 
6343
        brz view --all
6344
6344
 
6345
6345
      To delete all views::
6346
6346
 
6347
 
        bzr view --delete --all
 
6347
        brz view --delete --all
6348
6348
    """
6349
6349
 
6350
6350
    _see_also = []
6470
6470
 
6471
6471
      Remove the branch at repo/trunk::
6472
6472
 
6473
 
        bzr remove-branch repo/trunk
 
6473
        brz remove-branch repo/trunk
6474
6474
 
6475
6475
    """
6476
6476
 
6540
6540
        Option('all', help='Shelve all changes.'),
6541
6541
        'message',
6542
6542
        RegistryOption('writer', 'Method to use for writing diffs.',
6543
 
                       bzrlib.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 bzrlib.shelf_ui import Shelver
 
6556
        from breezy.shelf_ui import Shelver
6557
6557
        if writer is None:
6558
 
            writer = bzrlib.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 bzrlib.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()
6623
6623
    By default, only unknown files, not ignored files, are deleted.  Versioned
6624
6624
    files are never deleted.
6625
6625
 
6626
 
    Another class is 'detritus', which includes files emitted by bzr during
 
6626
    Another class is 'detritus', which includes files emitted by brz during
6627
6627
    normal operations and selftests.  (The value of these files decreases with
6628
6628
    time.)
6629
6629
 
6637
6637
                     Option('detritus', help='Delete conflict files, merge and revert'
6638
6638
                            ' backups, and failed selftest dirs.'),
6639
6639
                     Option('unknown',
6640
 
                            help='Delete files unknown to bzr (default).'),
 
6640
                            help='Delete files unknown to brz (default).'),
6641
6641
                     Option('dry-run', help='Show files to delete instead of'
6642
6642
                            ' deleting them.'),
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 bzrlib.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 bzrlib.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', [], 'bzrlib.bundle.commands'),
6725
 
        ('cmd_config', [], 'bzrlib.config'),
6726
 
        ('cmd_dpush', [], 'bzrlib.foreign'),
6727
 
        ('cmd_version_info', [], 'bzrlib.cmd_version_info'),
6728
 
        ('cmd_resolve', ['resolved'], 'bzrlib.conflicts'),
6729
 
        ('cmd_conflicts', [], 'bzrlib.conflicts'),
6730
 
        ('cmd_ping', [], 'bzrlib.smart.ping'),
6731
 
        ('cmd_sign_my_commits', [], 'bzrlib.commit_signature_commands'),
6732
 
        ('cmd_verify_signatures', [], 'bzrlib.commit_signature_commands'),
6733
 
        ('cmd_test_script', [], 'bzrlib.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)