~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib import (
27
27
    errors,
28
28
    log,
 
29
    registry,
29
30
    revisionspec,
30
31
    symbol_versioning,
31
32
    )
306
307
    Option.OPTIONS[name] = RegistryOption(name, help, registry, **kwargs)
307
308
 
308
309
 
 
310
class MergeTypeRegistry(registry.Registry):
 
311
 
 
312
    pass
 
313
 
 
314
 
 
315
_merge_type_registry = MergeTypeRegistry()
 
316
_merge_type_registry.register_lazy('merge3', 'bzrlib.merge', 'Merge3Merger',
 
317
                                   "Native diff3-style merge")
 
318
_merge_type_registry.register_lazy('diff3', 'bzrlib.merge', 'Diff3Merger',
 
319
                                   "Merge using external diff3")
 
320
_merge_type_registry.register_lazy('weave', 'bzrlib.merge', 'WeaveMerger',
 
321
                                   "Weave-based merge")
 
322
 
309
323
_global_option('all')
310
324
_global_option('overwrite', help='Ignore differences between branches and '
311
325
               'overwrite unconditionally')
349
363
_global_option('line', help='Use log format with one line per revision. Same as --log-format line')
350
364
_global_option('root', type=str)
351
365
_global_option('no-backup')
352
 
_global_option('merge-type', type=_parse_merge_type, 
353
 
               help='Select a particular merge algorithm')
 
366
_global_registry_option('merge-type', 'Select a particular merge algorithm',
 
367
                        _merge_type_registry, value_switches=True,
 
368
                        title='Merge algorithm')
354
369
_global_option('pattern', type=str)
355
370
_global_option('quiet', short_name='q')
356
371
_global_option('remember', help='Remember the specified location as a'