~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

(jelmer) Use 'development-subtree' format rather than
 'dirstate-with-subtree' in tests. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# TODO: For things like --diff-prefix, we want a way to customize the display
18
18
# of the option argument.
19
19
 
 
20
from __future__ import absolute_import
 
21
 
20
22
import optparse
21
23
import re
22
24
 
519
521
            _verbosity_level = -1
520
522
 
521
523
 
522
 
class MergeTypeRegistry(_mod_registry.Registry):
523
 
 
524
 
    pass
525
 
 
526
 
 
527
 
_merge_type_registry = MergeTypeRegistry()
528
 
_merge_type_registry.register_lazy('diff3', 'bzrlib.merge', 'Diff3Merger',
529
 
                                   "Merge using external diff3")
530
 
_merge_type_registry.register_lazy('lca', 'bzrlib.merge', 'LCAMerger',
531
 
                                   "LCA-newness merge")
532
 
_merge_type_registry.register_lazy('merge3', 'bzrlib.merge', 'Merge3Merger',
533
 
                                   "Native diff3-style merge")
534
 
_merge_type_registry.register_lazy('weave', 'bzrlib.merge', 'WeaveMerger',
535
 
                                   "Weave-based merge")
536
 
 
537
524
# Declare the standard options
538
525
_standard_option('help', short_name='h',
539
526
                 help='Show help message.')
547
534
                 custom_callback=_verbosity_level_callback)
548
535
 
549
536
# Declare commonly used options
550
 
_global_option('all')
551
 
_global_option('basis', type=str)
552
 
_global_option('bound')
553
537
_global_option('change',
554
538
               type=_parse_change_str,
555
539
               short_name='c',
556
540
               param_name='revision',
557
541
               help='Select changes introduced by the specified revision. See also "help revisionspec".')
558
 
_global_option('diff-options', type=str)
559
542
_global_option('directory', short_name='d', type=unicode,
560
 
               help='Branch to operate on, instead of working directory')
561
 
_global_option('dry-run',
562
 
               help="Show what would be done, but don't actually do anything.")
563
 
_global_option('email')
 
543
               help='Branch to operate on, instead of working directory.')
564
544
_global_option('file', type=unicode, short_name='F')
565
 
_global_option('force')
566
 
_global_option('format', type=unicode)
567
 
_global_option('forward')
568
 
_global_option('kind', type=str)
569
 
_global_option('line', help='Use log format with one line per revision.'
570
 
               ' Same as --log-format line')
571
545
_global_registry_option('log-format', "Use specified log format.",
572
546
                        lazy_registry=('bzrlib.log', 'log_formatter_registry'),
573
547
                        value_switches=True, title='Log format',
574
548
                        short_value_switches={'short': 'S'})
575
 
_global_option('long', help='Use detailed log format.'
576
 
               ' Same as --log-format long',
577
 
               short_name='l')
578
549
_global_registry_option('merge-type', 'Select a particular merge algorithm.',
579
 
                        _merge_type_registry, value_switches=True,
580
 
                        title='Merge algorithm')
 
550
                        lazy_registry=('bzrlib.merge', 'merge_type_registry'),
 
551
                        value_switches=True, title='Merge algorithm')
581
552
_global_option('message', type=unicode,
582
553
               short_name='m',
583
554
               help='Message string.')
584
 
_global_option('name-from-revision', help='The path name in the old tree.')
585
 
_global_option('no-backup')
586
 
_global_option('no-recurse')
587
555
_global_option('null', short_name='0',
588
556
                 help='Use an ASCII NUL (\\0) separator rather than '
589
557
                      'a newline.')
590
558
_global_option('overwrite', help='Ignore differences between branches and '
591
559
               'overwrite unconditionally.')
592
 
_global_option('pattern', type=str)
593
 
_global_option('profile',
594
 
               help='Show performance profiling information.')
595
 
_global_option('reprocess', help='Reprocess to reduce spurious conflicts.')
596
560
_global_option('remember', help='Remember the specified location as a'
597
561
               ' default.')
 
562
_global_option('reprocess', help='Reprocess to reduce spurious conflicts.')
598
563
_global_option('revision',
599
564
               type=_parse_revision_str,
600
565
               short_name='r',
601
566
               help='See "help revisionspec" for details.')
602
 
_global_option('short', help='Use moderately short log format.'
603
 
               ' Same as --log-format short')
604
567
_global_option('show-ids',
605
568
               help='Show internal object ids.')
606
569
_global_option('timezone',
607
570
               type=str,
608
571
               help='Display timezone as local, original, or utc.')
609
 
_global_option('root', type=str)
610
 
_global_option('unbound')
611
 
_global_option('update')
612
 
_global_option('version')
613
572
 
614
573
diff_writer_registry = _mod_registry.Registry()
615
574
diff_writer_registry.register('plain', lambda x: x, 'Plaintext diff output.')