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):
1419
1423
which tests should run.
1421
1425
# TODO: --list should give a list of all available tests
1427
# NB: this is used from the class without creating an instance, which is
1428
# why it does not have a self parameter.
1429
def get_transport_type(typestring):
1430
"""Parse and return a transport specifier."""
1431
if typestring == "sftp":
1432
from bzrlib.transport.sftp import SFTPAbsoluteServer
1433
return SFTPAbsoluteServer
1434
if typestring == "memory":
1435
from bzrlib.transport.memory import MemoryServer
1437
msg = "No known transport type %s. Supported types are: sftp\n" %\
1439
raise BzrCommandError(msg)
1423
1442
takes_args = ['testspecs*']
1424
1443
takes_options = ['verbose',
1425
1444
Option('one', help='stop when one test fails'),
1426
1445
Option('keep-output',
1427
help='keep output directories when tests fail')
1446
help='keep output directories when tests fail'),
1448
help='Use a different transport by default '
1449
'throughout the test suite.',
1450
type=get_transport_type),
1430
1453
def run(self, testspecs_list=None, verbose=False, one=False,
1454
keep_output=False, transport=None):
1432
1455
import bzrlib.ui
1433
1456
from bzrlib.tests import selftest
1434
1457
# we don't want progress meters from the tests to go to the
2045
2069
from bzrlib.merge import Merger, _MergeConflictHandler
2046
2070
if this_dir is None:
2047
2071
this_dir = u'.'
2048
this_branch = Branch.open_containing(this_dir)[0]
2072
this_tree = WorkingTree.open_containing(this_dir)[0]
2049
2073
if show_base and not merge_type is ApplyMerge3:
2050
2074
raise BzrCommandError("Show-base is not supported for this merge"
2051
2075
" type. %s" % merge_type)
2054
2078
" type. %s" % merge_type)
2055
2079
if reprocess and show_base:
2056
2080
raise BzrCommandError("Cannot reprocess and show base.")
2057
merger = Merger(this_branch)
2081
merger = Merger(this_tree.branch, this_tree=this_tree)
2058
2082
merger.check_basis(check_clean)
2059
2083
merger.set_other(other_revision)
2060
2084
merger.set_base(base_revision)