~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-12 08:52:45 UTC
  • mfrom: (2598.1.12 check-options)
  • Revision ID: pqm@pqm.ubuntu.com-20070712085245-afvocysw990c1a3z
cleanup global options, and require options to provide a help string

Show diffs side-by-side

added added

removed removed

Lines of Context:
338
338
    into a subdirectory of this one.
339
339
    """
340
340
    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.')]
 
341
    takes_options = [
 
342
        Option('no-recurse',
 
343
               help="Don't recursively add the contents of directories."),
 
344
        Option('dry-run',
 
345
               help="Show what would be done, but don't actually do anything."),
 
346
        'verbose',
 
347
        Option('file-ids-from',
 
348
               type=unicode,
 
349
               help='Lookup file ids from this tree.'),
 
350
        ]
344
351
    encoding_type = 'replace'
345
352
    _see_also = ['remove']
346
353
 
436
443
 
437
444
    hidden = True
438
445
    _see_also = ['ls']
439
 
    takes_options = ['revision', 'show-ids', 'kind']
 
446
    takes_options = [
 
447
        'revision',
 
448
        'show-ids',
 
449
        Option('kind',
 
450
               help='List entries of a particular kind: file, directory, symlink.',
 
451
               type=unicode),
 
452
        ]
440
453
    takes_args = ['file*']
441
454
 
442
455
    @display_command
443
456
    def run(self, revision=None, show_ids=False, kind=None, file_list=None):
444
457
        if kind and kind not in ['file', 'directory', 'symlink']:
445
 
            raise errors.BzrCommandError('invalid kind specified')
 
458
            raise errors.BzrCommandError('invalid kind %r specified' % (kind,))
446
459
 
447
460
        work_tree, file_list = tree_files(file_list)
448
461
        work_tree.lock_read()
1386
1399
 
1387
1400
    _see_also = ['status']
1388
1401
    takes_args = ['file*']
1389
 
    takes_options = ['revision', 'diff-options',
 
1402
    takes_options = [
 
1403
        Option('diff-options', type=str,
 
1404
               help='Pass these options to the external diff program.'),
1390
1405
        Option('prefix', type=str,
1391
1406
               short_name='p',
1392
1407
               help='Set prefixes to added to old and new filenames, as '
1393
1408
                    'two values separated by a colon. (eg "old/:new/").'),
 
1409
        'revision',
1394
1410
        ]
1395
1411
    aliases = ['di', 'dif']
1396
1412
    encoding_type = 'exact'
1584
1600
    takes_options = [
1585
1601
            Option('forward',
1586
1602
                   help='Show from oldest to newest.'),
1587
 
            'timezone',
 
1603
            Option('timezone',
 
1604
                   type=str,
 
1605
                   help='Display timezone as local, original, or utc.'),
1588
1606
            Option('verbose',
1589
1607
                   short_name='v',
1590
1608
                   help='Show files changed in each revision.'),
1732
1750
            Option('null',
1733
1751
                   help='Write an ascii NUL (\\0) separator '
1734
1752
                   'between files rather than a newline.'),
1735
 
            'kind',
 
1753
            Option('kind',
 
1754
                   help='List entries of a particular kind: file, directory, symlink.',
 
1755
                   type=unicode),
1736
1756
            'show-ids',
1737
1757
            ]
1738
1758
    @display_command
1739
 
    def run(self, revision=None, verbose=False, 
 
1759
    def run(self, revision=None, verbose=False,
1740
1760
            non_recursive=False, from_root=False,
1741
1761
            unknown=False, versioned=False, ignored=False,
1742
1762
            null=False, kind=None, show_ids=False, path=None):
1975
1995
         zip                          .zip
1976
1996
    """
1977
1997
    takes_args = ['dest', 'branch?']
1978
 
    takes_options = ['revision', 'format', 'root']
 
1998
    takes_options = [
 
1999
        Option('format',
 
2000
               help="Type of file to export to.",
 
2001
               type=unicode),
 
2002
        'revision',
 
2003
        Option('root',
 
2004
               type=str,
 
2005
               help="Name of the root directory inside the exported file."),
 
2006
        ]
1979
2007
    def run(self, dest, branch=None, revision=None, format=None, root=None):
1980
2008
        from bzrlib.export import export
1981
2009
 
2009
2037
    """
2010
2038
 
2011
2039
    _see_also = ['ls']
2012
 
    takes_options = ['revision', 'name-from-revision']
 
2040
    takes_options = [
 
2041
        Option('name-from-revision', help='The path name in the old tree.'),
 
2042
        'revision',
 
2043
        ]
2013
2044
    takes_args = ['filename']
2014
2045
    encoding_type = 'exact'
2015
2046
 
2103
2134
    _see_also = ['bugs', 'uncommit']
2104
2135
    takes_args = ['selected*']
2105
2136
    takes_options = [
2106
 
            'message',
 
2137
            Option('message', type=unicode,
 
2138
                   short_name='m',
 
2139
                   help="Description of the new revision."),
2107
2140
            'verbose',
2108
2141
             Option('unchanged',
2109
2142
                    help='Commit even if nothing has changed.'),
2571
2604
 
2572
2605
    _see_also = ['update', 'remerge', 'status-flags']
2573
2606
    takes_args = ['branch?']
2574
 
    takes_options = ['revision', 'force', 'merge-type', 'reprocess', 'remember',
 
2607
    takes_options = [
 
2608
        'revision',
 
2609
        Option('force',
 
2610
               help='Merge even if the destination tree has uncommitted changes.'),
 
2611
        'merge-type',
 
2612
        'reprocess',
 
2613
        'remember',
2575
2614
        Option('show-base', help="Show base revision text in "
2576
2615
               "conflicts."),
2577
2616
        Option('uncommitted', help='Apply uncommitted changes'
2581
2620
                ' source rather than merging.  When this happens,'
2582
2621
                ' you do not need to commit the result.'),
2583
2622
        Option('directory',
2584
 
            help='Branch to merge into, '
2585
 
                 'rather than the one containing the working directory.',
2586
 
            short_name='d',
2587
 
            type=unicode,
2588
 
            ),
 
2623
               help='Branch to merge into, '
 
2624
                    'rather than the one containing the working directory.',
 
2625
               short_name='d',
 
2626
               type=unicode,
 
2627
               ),
2589
2628
    ]
2590
2629
 
2591
2630
    def run(self, branch=None, revision=None, force=False, merge_type=None,
2840
2879
    """
2841
2880
 
2842
2881
    _see_also = ['cat', 'export']
2843
 
    takes_options = ['revision', 'no-backup']
 
2882
    takes_options = [
 
2883
            'revision',
 
2884
            Option('no-backup', "Do not save backups of reverted files."),
 
2885
            ]
2844
2886
    takes_args = ['file*']
2845
2887
 
2846
2888
    def run(self, revision=None, no_backup=False, file_list=None):