837
old_format = bzrdir.BzrDirFormat.get_default_format()
838
bzrdir.BzrDirFormat.set_default_format(bzrdir.BzrDirMetaFormat1())
840
source.create_checkout(to_location, revision_id, lightweight)
842
bzrdir.BzrDirFormat.set_default_format(old_format)
837
source.create_checkout(to_location, revision_id, lightweight)
845
840
class cmd_renames(Command):
2058
2053
class cmd_selftest(Command):
2059
2054
"""Run internal test suite.
2061
This creates temporary test directories in the working directory,
2062
but not existing data is affected. These directories are deleted
2063
if the tests pass, or left behind to help in debugging if they
2064
fail and --keep-output is specified.
2056
This creates temporary test directories in the working directory, but not
2057
existing data is affected. These directories are deleted if the tests
2058
pass, or left behind to help in debugging if they fail and --keep-output
2066
If arguments are given, they are regular expressions that say
2067
which tests should run.
2061
If arguments are given, they are regular expressions that say which tests
2062
should run. Tests matching any expression are run, and other tests are
2065
Alternatively if --first is given, matching tests are run first and then
2066
all other tests are run. This is useful if you have been working in a
2067
particular area, but want to make sure nothing else was broken.
2069
2069
If the global option '--no-plugins' is given, plugins are not loaded
2070
2070
before running the selftests. This has two effects: features provided or
2071
2071
modified by plugins will not be tested, and tests provided by plugins will
2075
2075
bzr selftest ignore
2076
run only tests relating to 'ignore'
2076
2077
bzr --no-plugins selftest -v
2078
disable plugins and list tests as they're run
2078
2080
# TODO: --list should give a list of all available tests
2114
2116
Option('clean-output',
2115
2117
help='clean temporary tests directories'
2116
2118
' without running tests'),
2120
help='run all tests, but run specified tests first',
2118
2123
encoding_type = 'replace'
2120
2125
def run(self, testspecs_list=None, verbose=None, one=False,
2121
2126
keep_output=False, transport=None, benchmark=None,
2122
lsprof_timed=None, cache_dir=None, clean_output=False):
2127
lsprof_timed=None, cache_dir=None, clean_output=False,
2123
2129
import bzrlib.ui
2124
2130
from bzrlib.tests import selftest
2125
2131
import bzrlib.benchmarks as benchmarks
2158
2164
transport=transport,
2159
2165
test_suite_factory=test_suite_factory,
2160
2166
lsprof_timed=lsprof_timed,
2161
bench_history=benchfile)
2167
bench_history=benchfile,
2168
matching_tests_first=first,
2163
2171
if benchfile is not None:
2164
2172
benchfile.close()