30
30
from bzrlib.errors import (BzrError, BzrCheckError, BzrCommandError,
31
31
NotBranchError, DivergedBranches, NotConflicted,
32
32
NoSuchFile, NoWorkingTree, FileInWrongBranch)
33
from bzrlib.log import show_one_log
33
34
from bzrlib.option import Option
34
35
from bzrlib.revisionspec import RevisionSpec
35
36
import bzrlib.trace
36
37
from bzrlib.trace import mutter, note, log_error, warning, is_quiet
38
from bzrlib.transport.local import LocalTransport
37
39
from bzrlib.workingtree import WorkingTree
38
from bzrlib.log import show_one_log
41
42
def tree_files(file_list, default_branch=u'.'):
497
498
if new_transport.base == transport.base:
498
499
raise BzrCommandError("Could not creeate "
500
br_to = Branch.initialize(location)
501
if isinstance(transport, LocalTransport):
502
br_to = WorkingTree.create_standalone(location).branch
504
br_to = Branch.create(location)
501
505
old_rh = br_to.revision_history()
1360
1364
"""Upgrade branch storage to current format.
1362
1366
The check command or bzr developers may sometimes advise you to run
1365
This version of this command upgrades from the full-text storage
1366
used by bzr 0.0.8 and earlier to the weave format (v5).
1367
this command. When the default format has changed you may also be warned
1368
during other operations to upgrade.
1368
takes_args = ['dir?']
1370
takes_args = ['url?']
1370
def run(self, dir=u'.'):
1372
def run(self, url='.'):
1371
1373
from bzrlib.upgrade import upgrade
1375
1377
class cmd_whoami(Command):
1418
1422
If arguments are given, they are regular expressions that say
1419
1423
which tests should run.
1425
If the global option '--no-plugins' is given, plugins are not loaded
1426
before running the selftests. This has two effects: features provided or
1427
modified by plugins will not be tested, and tests provided by plugins will
1432
bzr --no-plugins selftest -v
1421
1434
# TODO: --list should give a list of all available tests
1436
# NB: this is used from the class without creating an instance, which is
1437
# why it does not have a self parameter.
1438
def get_transport_type(typestring):
1439
"""Parse and return a transport specifier."""
1440
if typestring == "sftp":
1441
from bzrlib.transport.sftp import SFTPAbsoluteServer
1442
return SFTPAbsoluteServer
1443
if typestring == "memory":
1444
from bzrlib.transport.memory import MemoryServer
1446
msg = "No known transport type %s. Supported types are: sftp\n" %\
1448
raise BzrCommandError(msg)
1423
1451
takes_args = ['testspecs*']
1424
takes_options = ['verbose',
1452
takes_options = ['verbose',
1425
1453
Option('one', help='stop when one test fails'),
1426
1454
Option('keep-output',
1427
help='keep output directories when tests fail')
1455
help='keep output directories when tests fail'),
1457
help='Use a different transport by default '
1458
'throughout the test suite.',
1459
type=get_transport_type),
1430
1462
def run(self, testspecs_list=None, verbose=False, one=False,
1463
keep_output=False, transport=None):
1432
1464
import bzrlib.ui
1433
1465
from bzrlib.tests import selftest
1434
1466
# we don't want progress meters from the tests to go to the
2046
2079
from bzrlib.merge import Merger, _MergeConflictHandler
2047
2080
if this_dir is None:
2048
2081
this_dir = u'.'
2049
this_branch = Branch.open_containing(this_dir)[0]
2082
this_tree = WorkingTree.open_containing(this_dir)[0]
2050
2083
if show_base and not merge_type is ApplyMerge3:
2051
2084
raise BzrCommandError("Show-base is not supported for this merge"
2052
2085
" type. %s" % merge_type)
2055
2088
" type. %s" % merge_type)
2056
2089
if reprocess and show_base:
2057
2090
raise BzrCommandError("Cannot reprocess and show base.")
2058
merger = Merger(this_branch)
2091
merger = Merger(this_tree.branch, this_tree=this_tree)
2059
2092
merger.check_basis(check_clean)
2060
2093
merger.set_other(other_revision)
2061
2094
merger.set_base(base_revision)