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):
1428
1432
bzr --no-plugins selftest -v
1430
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)
1432
1451
takes_args = ['testspecs*']
1433
1452
takes_options = ['verbose',
1434
1453
Option('one', help='stop when one test fails'),
1435
1454
Option('keep-output',
1436
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),
1439
1462
def run(self, testspecs_list=None, verbose=False, one=False,
1463
keep_output=False, transport=None):
1441
1464
import bzrlib.ui
1442
1465
from bzrlib.tests import selftest
1443
1466
# we don't want progress meters from the tests to go to the
2054
2078
from bzrlib.merge import Merger, _MergeConflictHandler
2055
2079
if this_dir is None:
2056
2080
this_dir = u'.'
2057
this_branch = Branch.open_containing(this_dir)[0]
2081
this_tree = WorkingTree.open_containing(this_dir)[0]
2058
2082
if show_base and not merge_type is ApplyMerge3:
2059
2083
raise BzrCommandError("Show-base is not supported for this merge"
2060
2084
" type. %s" % merge_type)
2063
2087
" type. %s" % merge_type)
2064
2088
if reprocess and show_base:
2065
2089
raise BzrCommandError("Cannot reprocess and show base.")
2066
merger = Merger(this_branch)
2090
merger = Merger(this_tree.branch, this_tree=this_tree)
2067
2091
merger.check_basis(check_clean)
2068
2092
merger.set_other(other_revision)
2069
2093
merger.set_base(base_revision)