338
339
into a subdirectory of this one.
340
341
takes_args = ['file*']
341
takes_options = ['no-recurse', 'dry-run', 'verbose',
342
Option('file-ids-from', type=unicode,
343
help='Lookup file ids from this tree.')]
344
help="Don't recursively add the contents of directories."),
346
help="Show what would be done, but don't actually do anything."),
348
Option('file-ids-from',
350
help='Lookup file ids from this tree.'),
344
352
encoding_type = 'replace'
345
353
_see_also = ['remove']
438
446
_see_also = ['ls']
439
takes_options = ['revision', 'show-ids', 'kind']
451
help='List entries of a particular kind: file, directory, symlink.',
440
454
takes_args = ['file*']
443
457
def run(self, revision=None, show_ids=False, kind=None, file_list=None):
444
458
if kind and kind not in ['file', 'directory', 'symlink']:
445
raise errors.BzrCommandError('invalid kind specified')
459
raise errors.BzrCommandError('invalid kind %r specified' % (kind,))
447
461
work_tree, file_list = tree_files(file_list)
448
462
work_tree.lock_read()
741
755
"\nYou may supply --create-prefix to create all"
742
756
" leading parent directories."
745
758
_create_prefix(to_transport)
747
760
# Now the target directory exists, but doesn't have a .bzr
1010
1023
tree.lock_tree_write()
1012
1025
existing_pending_merges = tree.get_parent_ids()[1:]
1013
last_rev = tree.last_revision()
1014
if last_rev == tree.branch.last_revision():
1026
last_rev = _mod_revision.ensure_null(tree.last_revision())
1027
if last_rev == _mod_revision.ensure_null(
1028
tree.branch.last_revision()):
1015
1029
# may be up to date, check master too.
1016
1030
master = tree.branch.get_master_branch()
1017
if master is None or last_rev == master.last_revision():
1031
if master is None or last_rev == _mod_revision.ensure_null(
1032
master.last_revision()):
1018
1033
revno = tree.branch.revision_id_to_revno(last_rev)
1019
1034
note("Tree is up to date at revision %d." % (revno,))
1021
1036
conflicts = tree.update(delta._ChangeReporter(
1022
1037
unversioned_filter=tree.is_ignored))
1023
revno = tree.branch.revision_id_to_revno(tree.last_revision())
1038
revno = tree.branch.revision_id_to_revno(
1039
_mod_revision.ensure_null(tree.last_revision()))
1024
1040
note('Updated to revision %d.' % (revno,))
1025
1041
if tree.get_parent_ids()[1:] != existing_pending_merges:
1026
1042
note('Your local commits will now show as pending merges with '
1387
1403
_see_also = ['status']
1388
1404
takes_args = ['file*']
1389
takes_options = ['revision', 'diff-options',
1406
Option('diff-options', type=str,
1407
help='Pass these options to the external diff program.'),
1390
1408
Option('prefix', type=str,
1391
1409
short_name='p',
1392
1410
help='Set prefixes to added to old and new filenames, as '
1393
1411
'two values separated by a colon. (eg "old/:new/").'),
1395
1414
aliases = ['di', 'dif']
1396
1415
encoding_type = 'exact'
1584
1603
takes_options = [
1585
1604
Option('forward',
1586
1605
help='Show from oldest to newest.'),
1608
help='Display timezone as local, original, or utc.'),
1588
1609
Option('verbose',
1589
1610
short_name='v',
1590
1611
help='Show files changed in each revision.'),
1733
1754
help='Write an ascii NUL (\\0) separator '
1734
1755
'between files rather than a newline.'),
1757
help='List entries of a particular kind: file, directory, symlink.',
1738
1761
@display_command
1739
def run(self, revision=None, verbose=False,
1762
def run(self, revision=None, verbose=False,
1740
1763
non_recursive=False, from_root=False,
1741
1764
unknown=False, versioned=False, ignored=False,
1742
1765
null=False, kind=None, show_ids=False, path=None):
1977
2000
takes_args = ['dest', 'branch?']
1978
takes_options = ['revision', 'format', 'root']
2003
help="Type of file to export to.",
2008
help="Name of the root directory inside the exported file."),
1979
2010
def run(self, dest, branch=None, revision=None, format=None, root=None):
1980
2011
from bzrlib.export import export
2011
2042
_see_also = ['ls']
2012
takes_options = ['revision', 'name-from-revision']
2044
Option('name-from-revision', help='The path name in the old tree.'),
2013
2047
takes_args = ['filename']
2014
2048
encoding_type = 'exact'
2103
2137
_see_also = ['bugs', 'uncommit']
2104
2138
takes_args = ['selected*']
2105
2139
takes_options = [
2140
Option('message', type=unicode,
2142
help="Description of the new revision."),
2108
2144
Option('unchanged',
2109
2145
help='Commit even if nothing has changed.'),
2369
2405
modified by plugins will not be tested, and tests provided by plugins will
2408
Tests that need working space on disk use a common temporary directory,
2409
typically inside $TMPDIR or /tmp.
2373
2412
bzr selftest ignore
2374
2413
run only tests relating to 'ignore'
2375
2414
bzr --no-plugins selftest -v
2376
2415
disable plugins and list tests as they're run
2378
For each test, that needs actual disk access, bzr create their own
2379
subdirectory in the temporary testing directory (testXXXX.tmp).
2380
By default the name of such subdirectory is based on the name of the test.
2381
If option '--numbered-dirs' is given, bzr will use sequent numbers
2382
of running tests to create such subdirectories. This is default behavior
2383
on Windows because of path length limitation.
2385
2417
# NB: this is used from the class without creating an instance, which is
2386
2418
# why it does not have a self parameter.
2406
2438
help='Stop when one test fails.',
2407
2439
short_name='1',
2409
Option('keep-output',
2410
help='Keep output directories when tests fail.'),
2411
2441
Option('transport',
2412
2442
help='Use a different transport by default '
2413
2443
'throughout the test suite.',
2420
2450
Option('cache-dir', type=str,
2421
2451
help='Cache intermediate benchmark output in this '
2423
Option('clean-output',
2424
help='Clean temporary tests directories'
2425
' without running tests.'),
2426
2453
Option('first',
2427
2454
help='Run all tests, but run specified tests first.',
2428
2455
short_name='f',
2430
Option('numbered-dirs',
2431
help='Use numbered dirs for TestCaseInTempDir.'),
2432
2457
Option('list-only',
2433
2458
help='List the tests instead of running them.'),
2434
2459
Option('randomize', type=str, argname="SEED",
2442
2467
encoding_type = 'replace'
2444
2469
def run(self, testspecs_list=None, verbose=None, one=False,
2445
keep_output=False, transport=None, benchmark=None,
2446
lsprof_timed=None, cache_dir=None, clean_output=False,
2447
first=False, numbered_dirs=None, list_only=False,
2470
transport=None, benchmark=None,
2471
lsprof_timed=None, cache_dir=None,
2472
first=False, list_only=False,
2448
2473
randomize=None, exclude=None):
2449
2474
import bzrlib.ui
2450
2475
from bzrlib.tests import selftest
2451
2476
import bzrlib.benchmarks as benchmarks
2452
2477
from bzrlib.benchmarks import tree_creator
2455
from bzrlib.tests import clean_selftest_output
2456
clean_selftest_output()
2459
warning("notice: selftest --keep-output "
2460
"is no longer supported; "
2461
"test output is always removed")
2463
if numbered_dirs is None and sys.platform == 'win32':
2464
numbered_dirs = True
2478
from bzrlib.version import show_version
2466
2480
if cache_dir is not None:
2467
2481
tree_creator.TreeCreator.CACHE_ROOT = osutils.abspath(cache_dir)
2468
print '%10s: %s' % ('bzr', osutils.realpath(sys.argv[0]))
2469
print '%10s: %s' % ('bzrlib', bzrlib.__path__[0])
2483
show_version(show_config=False, show_copyright=False)
2471
2485
if testspecs_list is not None:
2472
2486
pattern = '|'.join(testspecs_list)
2484
2498
verbose = False
2485
2499
benchfile = None
2487
result = selftest(verbose=verbose,
2501
result = selftest(verbose=verbose,
2488
2502
pattern=pattern,
2489
stop_on_failure=one,
2503
stop_on_failure=one,
2490
2504
transport=transport,
2491
2505
test_suite_factory=test_suite_factory,
2492
2506
lsprof_timed=lsprof_timed,
2493
2507
bench_history=benchfile,
2494
2508
matching_tests_first=first,
2495
numbered_dirs=numbered_dirs,
2496
2509
list_only=list_only,
2497
2510
random_seed=randomize,
2498
2511
exclude_pattern=exclude
2596
2609
_see_also = ['update', 'remerge', 'status-flags']
2597
2610
takes_args = ['branch?']
2598
takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
2614
help='Merge even if the destination tree has uncommitted changes.'),
2599
2618
Option('show-base', help="Show base revision text in "
2601
2620
Option('uncommitted', help='Apply uncommitted changes'
2605
2624
' source rather than merging. When this happens,'
2606
2625
' you do not need to commit the result.'),
2607
2626
Option('directory',
2608
help='Branch to merge into, '
2609
'rather than the one containing the working directory.',
2627
help='Branch to merge into, '
2628
'rather than the one containing the working directory.',
2615
2634
def run(self, branch=None, revision=None, force=False, merge_type=None,
2866
2885
_see_also = ['cat', 'export']
2867
takes_options = ['revision', 'no-backup']
2888
Option('no-backup', "Do not save backups of reverted files."),
2868
2890
takes_args = ['file*']
2870
2892
def run(self, revision=None, no_backup=False, file_list=None):
3047
3069
return status_code
3072
class cmd_pack(Command):
3073
"""Compress the data within a repository."""
3075
_see_also = ['repositories']
3076
takes_args = ['branch_or_repo?']
3078
def run(self, branch_or_repo='.'):
3079
dir = bzrdir.BzrDir.open_containing(branch_or_repo)[0]
3081
branch = dir.open_branch()
3082
repository = branch.repository
3083
except errors.NotBranchError:
3084
repository = dir.open_repository()
3050
3088
class cmd_plugins(Command):
3051
3089
"""List plugins"""
3776
3814
new_transport = cur_transport.clone('..')
3777
3815
if new_transport.base == cur_transport.base:
3778
raise errors.BzrCommandError("Failed to create path"
3816
raise errors.BzrCommandError(
3817
"Failed to create path prefix for %s."
3818
% cur_transport.base)
3782
3820
new_transport.mkdir('.')
3783
3821
except errors.NoSuchFile: