186
170
takes_args = ['file*']
187
171
takes_options = ['show-ids', 'revision',
188
Option('short', help='Give short SVN-style status lines'),
189
Option('versioned', help='Only show versioned files')]
172
Option('short', help='Give short SVN-style status lines.'),
173
Option('versioned', help='Only show versioned files.')]
190
174
aliases = ['st', 'stat']
192
176
encoding_type = 'replace'
193
_see_also = ['diff', 'revert']
177
_see_also = ['diff', 'revert', 'status-flags']
196
180
def run(self, show_ids=False, file_list=None, revision=None, short=False,
450
446
_see_also = ['ls']
451
takes_options = ['revision', 'show-ids', 'kind']
451
help='List entries of a particular kind: file, directory, symlink.',
452
454
takes_args = ['file*']
455
457
def run(self, revision=None, show_ids=False, kind=None, file_list=None):
456
458
if kind and kind not in ['file', 'directory', 'symlink']:
457
raise errors.BzrCommandError('invalid kind specified')
459
raise errors.BzrCommandError('invalid kind %r specified' % (kind,))
459
461
work_tree, file_list = tree_files(file_list)
460
462
work_tree.lock_read()
565
567
location can be accessed.
568
_see_also = ['push', 'update']
570
_see_also = ['push', 'update', 'status-flags']
569
571
takes_options = ['remember', 'overwrite', 'revision', 'verbose',
570
572
Option('directory',
571
help='branch to pull into, '
572
'rather than the one containing the working directory',
573
help='Branch to pull into, '
574
'rather than the one containing the working directory.',
676
678
takes_options = ['remember', 'overwrite', 'verbose',
677
679
Option('create-prefix',
678
680
help='Create the path leading up to the branch '
679
'if it does not already exist'),
681
'if it does not already exist.'),
680
682
Option('directory',
681
help='branch to push from, '
682
'rather than the one containing the working directory',
683
help='Branch to push from, '
684
'rather than the one containing the working directory.',
686
688
Option('use-existing-dir',
687
689
help='By default push will fail if the target'
688
690
' directory exists, but does not already'
689
' have a control directory. This flag will'
691
' have a control directory. This flag will'
690
692
' allow push to proceed.'),
692
694
takes_args = ['location?']
1022
1023
tree.lock_tree_write()
1024
1025
existing_pending_merges = tree.get_parent_ids()[1:]
1025
last_rev = tree.last_revision()
1026
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()):
1027
1029
# may be up to date, check master too.
1028
1030
master = tree.branch.get_master_branch()
1029
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()):
1030
1033
revno = tree.branch.revision_id_to_revno(last_rev)
1031
1034
note("Tree is up to date at revision %d." % (revno,))
1033
conflicts = tree.update()
1034
revno = tree.branch.revision_id_to_revno(tree.last_revision())
1036
conflicts = tree.update(delta._ChangeReporter(
1037
unversioned_filter=tree.is_ignored))
1038
revno = tree.branch.revision_id_to_revno(
1039
_mod_revision.ensure_null(tree.last_revision()))
1035
1040
note('Updated to revision %d.' % (revno,))
1036
1041
if tree.get_parent_ids()[1:] != existing_pending_merges:
1037
1042
note('Your local commits will now show as pending merges with '
1336
1341
takes_args = ["location"]
1337
1342
takes_options = [RegistryOption('format',
1338
1343
help='Specify a format for this repository. See'
1339
' "bzr help formats" for details',
1344
' "bzr help formats" for details.',
1340
1345
registry=bzrdir.format_registry,
1341
1346
converter=bzrdir.format_registry.make_bzrdir,
1342
1347
value_switches=True, title='Repository format'),
1343
1348
Option('no-trees',
1344
1349
help='Branches in the repository will default to'
1345
' not having a working tree'),
1350
' not having a working tree.'),
1347
1352
aliases = ["init-repo"]
1592
1600
# TODO: Make --revision support uuid: and hash: [future tag:] notation.
1594
1602
takes_args = ['location?']
1595
takes_options = [Option('forward',
1596
help='show from oldest to newest'),
1600
help='show files changed in each revision'),
1601
'show-ids', 'revision',
1605
help='show revisions whose message matches this regexp',
1608
help='limit the output to the first N revisions',
1605
help='Show from oldest to newest.'),
1608
help='Display timezone as local, original, or utc.'),
1611
help='Show files changed in each revision.'),
1617
help='Show revisions whose message matches this '
1618
'regular expression.',
1621
help='Limit the output to the first N revisions.',
1611
1625
encoding_type = 'replace'
1613
1627
@display_command
1665
1679
raise errors.BzrCommandError(
1666
1680
"Log doesn't accept two revisions in different"
1668
if revision[0].spec is None:
1669
# missing begin-range means first revision
1672
rev1 = revision[0].in_history(b).revno
1674
if revision[1].spec is None:
1675
# missing end-range means last known revision
1678
rev2 = revision[1].in_history(b).revno
1682
rev1 = revision[0].in_history(b)
1683
rev2 = revision[1].in_history(b)
1680
1685
raise errors.BzrCommandError(
1681
1686
'bzr log --revision takes one or two values.')
1683
# By this point, the revision numbers are converted to the +ve
1684
# form if they were supplied in the -ve form, so we can do
1685
# this comparison in relative safety
1687
(rev2, rev1) = (rev1, rev2)
1689
1688
if log_format is None:
1690
1689
log_format = log.log_formatter_registry.get_default(b)
1741
1740
_see_also = ['status', 'cat']
1742
1741
takes_args = ['path?']
1743
1742
# TODO: Take a revision or remote path and list that tree instead.
1744
takes_options = ['verbose', 'revision',
1745
Option('non-recursive',
1746
help='don\'t recurse into sub-directories'),
1748
help='Print all paths from the root of the branch.'),
1749
Option('unknown', help='Print unknown files'),
1750
Option('versioned', help='Print versioned files'),
1751
Option('ignored', help='Print ignored files'),
1753
Option('null', help='Null separate the files'),
1746
Option('non-recursive',
1747
help='Don\'t recurse into subdirectories.'),
1749
help='Print paths relative to the root of the branch.'),
1750
Option('unknown', help='Print unknown files.'),
1751
Option('versioned', help='Print versioned files.'),
1752
Option('ignored', help='Print ignored files.'),
1754
help='Write an ascii NUL (\\0) separator '
1755
'between files rather than a newline.'),
1757
help='List entries of a particular kind: file, directory, symlink.',
1756
1761
@display_command
1757
def run(self, revision=None, verbose=False,
1762
def run(self, revision=None, verbose=False,
1758
1763
non_recursive=False, from_root=False,
1759
1764
unknown=False, versioned=False, ignored=False,
1760
1765
null=False, kind=None, show_ids=False, path=None):
2121
2137
_see_also = ['bugs', 'uncommit']
2122
2138
takes_args = ['selected*']
2123
takes_options = ['message', 'verbose',
2125
help='commit even if nothing has changed'),
2126
Option('file', type=str,
2129
help='file containing commit message'),
2131
help="refuse to commit if there are unknown "
2132
"files in the working tree."),
2133
ListOption('fixes', type=str,
2134
help="mark a bug as being fixed by this "
2137
help="perform a local only commit in a bound "
2138
"branch. Such commits are not pushed to "
2139
"the master branch until a normal commit "
2140
Option('message', type=unicode,
2142
help="Description of the new revision."),
2145
help='Commit even if nothing has changed.'),
2146
Option('file', type=str,
2149
help='Take commit message from this file.'),
2151
help="Refuse to commit if there are unknown "
2152
"files in the working tree."),
2153
ListOption('fixes', type=str,
2154
help="Mark a bug as being fixed by this revision."),
2156
help="Perform a local commit in a bound "
2157
"branch. Local commits are not pushed to "
2158
"the master branch until a normal commit "
2143
2162
aliases = ['ci', 'checkin']
2145
2164
def _get_bug_fix_properties(self, fixes, branch):
2386
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.
2390
2412
bzr selftest ignore
2391
2413
run only tests relating to 'ignore'
2392
2414
bzr --no-plugins selftest -v
2393
2415
disable plugins and list tests as they're run
2395
For each test, that needs actual disk access, bzr create their own
2396
subdirectory in the temporary testing directory (testXXXX.tmp).
2397
By default the name of such subdirectory is based on the name of the test.
2398
If option '--numbered-dirs' is given, bzr will use sequent numbers
2399
of running tests to create such subdirectories. This is default behavior
2400
on Windows because of path length limitation.
2402
2417
# NB: this is used from the class without creating an instance, which is
2403
2418
# why it does not have a self parameter.
2420
2435
takes_args = ['testspecs*']
2421
2436
takes_options = ['verbose',
2423
help='stop when one test fails',
2438
help='Stop when one test fails.',
2424
2439
short_name='1',
2426
Option('keep-output',
2427
help='keep output directories when tests fail'),
2428
2441
Option('transport',
2429
2442
help='Use a different transport by default '
2430
2443
'throughout the test suite.',
2431
2444
type=get_transport_type),
2432
Option('benchmark', help='run the bzr benchmarks.'),
2446
help='Run the benchmarks rather than selftests.'),
2433
2447
Option('lsprof-timed',
2434
help='generate lsprof output for benchmarked'
2448
help='Generate lsprof output for benchmarked'
2435
2449
' sections of code.'),
2436
2450
Option('cache-dir', type=str,
2437
help='a directory to cache intermediate'
2438
' benchmark steps'),
2439
Option('clean-output',
2440
help='clean temporary tests directories'
2441
' without running tests'),
2451
help='Cache intermediate benchmark output in this '
2442
2453
Option('first',
2443
help='run all tests, but run specified tests first',
2454
help='Run all tests, but run specified tests first.',
2444
2455
short_name='f',
2446
Option('numbered-dirs',
2447
help='use numbered dirs for TestCaseInTempDir'),
2448
2457
Option('list-only',
2449
help='list the tests instead of running them'),
2458
help='List the tests instead of running them.'),
2450
2459
Option('randomize', type=str, argname="SEED",
2451
help='randomize the order of tests using the given'
2452
' seed or "now" for the current time'),
2460
help='Randomize the order of tests using the given'
2461
' seed or "now" for the current time.'),
2453
2462
Option('exclude', type=str, argname="PATTERN",
2454
2463
short_name='x',
2455
help='exclude tests that match this regular'
2464
help='Exclude tests that match this regular'
2458
2467
encoding_type = 'replace'
2460
2469
def run(self, testspecs_list=None, verbose=None, one=False,
2461
keep_output=False, transport=None, benchmark=None,
2462
lsprof_timed=None, cache_dir=None, clean_output=False,
2463
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,
2464
2473
randomize=None, exclude=None):
2465
2474
import bzrlib.ui
2466
2475
from bzrlib.tests import selftest
2467
2476
import bzrlib.benchmarks as benchmarks
2468
2477
from bzrlib.benchmarks import tree_creator
2471
from bzrlib.tests import clean_selftest_output
2472
clean_selftest_output()
2475
warning("notice: selftest --keep-output "
2476
"is no longer supported; "
2477
"test output is always removed")
2479
if numbered_dirs is None and sys.platform == 'win32':
2480
numbered_dirs = True
2478
from bzrlib.version import show_version
2482
2480
if cache_dir is not None:
2483
2481
tree_creator.TreeCreator.CACHE_ROOT = osutils.abspath(cache_dir)
2484
print '%10s: %s' % ('bzr', osutils.realpath(sys.argv[0]))
2485
print '%10s: %s' % ('bzrlib', bzrlib.__path__[0])
2483
show_version(show_config=False, show_copyright=False)
2487
2485
if testspecs_list is not None:
2488
2486
pattern = '|'.join(testspecs_list)
2609
2606
--force is given.
2612
_see_also = ['update', 'remerge']
2609
_see_also = ['update', 'remerge', 'status-flags']
2613
2610
takes_args = ['branch?']
2614
takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
2614
help='Merge even if the destination tree has uncommitted changes.'),
2615
2618
Option('show-base', help="Show base revision text in "
2617
2620
Option('uncommitted', help='Apply uncommitted changes'
2618
' from a working copy, instead of branch changes'),
2621
' from a working copy, instead of branch changes.'),
2619
2622
Option('pull', help='If the destination is already'
2620
2623
' completely merged into the source, pull from the'
2621
' source rather than merging. When this happens,'
2624
' source rather than merging. When this happens,'
2622
2625
' you do not need to commit the result.'),
2623
2626
Option('directory',
2624
help='Branch to merge into, '
2625
'rather than the one containing the working directory',
2627
help='Branch to merge into, '
2628
'rather than the one containing the working directory.',
2631
2634
def run(self, branch=None, revision=None, force=False, merge_type=None,
2969
2980
_see_also = ['merge', 'pull']
2970
2981
takes_args = ['other_branch?']
2971
takes_options = [Option('reverse', 'Reverse the order of revisions'),
2973
'Display changes in the local branch only'),
2974
Option('this' , 'same as --mine-only'),
2975
Option('theirs-only',
2976
'Display changes in the remote branch only'),
2977
Option('other', 'same as --theirs-only'),
2983
Option('reverse', 'Reverse the order of revisions.'),
2985
'Display changes in the local branch only.'),
2986
Option('this' , 'Same as --mine-only.'),
2987
Option('theirs-only',
2988
'Display changes in the remote branch only.'),
2989
Option('other', 'Same as --theirs-only.'),
2982
2994
encoding_type = 'replace'
2984
2996
@display_command
3080
3108
class cmd_testament(Command):
3081
3109
"""Show testament (signing-form) of a revision."""
3082
takes_options = ['revision',
3083
Option('long', help='Produce long-format testament'),
3084
Option('strict', help='Produce a strict-format'
3112
Option('long', help='Produce long-format testament.'),
3114
help='Produce a strict-format testament.')]
3086
3115
takes_args = ['branch?']
3087
3116
@display_command
3088
3117
def run(self, branch=u'.', revision=None, long=False, strict=False):
3121
3150
# with new uncommitted lines marked
3122
3151
aliases = ['ann', 'blame', 'praise']
3123
3152
takes_args = ['filename']
3124
takes_options = [Option('all', help='show annotations on all lines'),
3125
Option('long', help='show date in annotations'),
3153
takes_options = [Option('all', help='Show annotations on all lines.'),
3154
Option('long', help='Show commit date in annotations.'),
3158
encoding_type = 'exact'
3130
3160
@display_command
3131
3161
def run(self, filename, all=False, long=False, revision=None,
3368
3398
takes_options = [
3370
help='serve on stdin/out for use from inetd or sshd'),
3400
help='Serve on stdin/out for use from inetd or sshd.'),
3372
help='listen for connections on nominated port of the form '
3373
'[hostname:]portnumber. Passing 0 as the port number will '
3374
'result in a dynamically allocated port. Default port is '
3402
help='Listen for connections on nominated port of the form '
3403
'[hostname:]portnumber. Passing 0 as the port number will '
3404
'result in a dynamically allocated port. The default port is '
3377
3407
Option('directory',
3378
help='serve contents of directory',
3408
help='Serve contents of this directory.',
3380
3410
Option('allow-writes',
3381
help='By default the server is a readonly server. Supplying '
3411
help='By default the server is a readonly server. Supplying '
3382
3412
'--allow-writes enables write access to the contents of '
3383
'the served directory and below. '
3413
'the served directory and below.'
3527
3559
takes_options = [
3528
3560
RegistryOption.from_kwargs('patch-type',
3529
3561
'The type of patch to include in the directive',
3530
title='Patch type', value_switches=True, enum_switch=False,
3531
bundle='Bazaar revision bundle (default)',
3532
diff='Normal unified diff',
3533
plain='No patch, just directive'),
3534
Option('sign', help='GPG-sign the directive'), 'revision',
3563
value_switches=True,
3565
bundle='Bazaar revision bundle (default).',
3566
diff='Normal unified diff.',
3567
plain='No patch, just directive.'),
3568
Option('sign', help='GPG-sign the directive.'), 'revision',
3535
3569
Option('mail-to', type=str,
3536
help='Instead of printing the directive, email to this address'),
3570
help='Instead of printing the directive, email to this address.'),
3537
3571
Option('message', type=str, short_name='m',
3538
help='Message to use when committing this merge')
3572
help='Message to use when committing this merge.')
3541
3575
encoding_type = 'exact'