~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-20 13:31:00 UTC
  • mto: This revision was merged to the branch mainline in revision 6153.
  • Revision ID: jriddell@canonical.com-20110920133100-kpsomvcnjoxv6n6b
syntax fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
2361
2361
                raise AssertionError(
2362
2362
                    'Only empty lists are supported as default values')
2363
2363
            self.default = u','
2364
 
        elif isinstance(default, (str, unicode, bool, int, float)):
 
2364
        elif isinstance(default, (str, unicode, bool, int)):
2365
2365
            # Rely on python to convert strings, booleans and integers
2366
2366
            self.default = u'%s' % (default,)
2367
2367
        else:
2426
2426
    return int(unicode_str)
2427
2427
 
2428
2428
 
2429
 
def float_from_store(unicode_str):
2430
 
    return float(unicode_str)
2431
 
 
2432
 
 
2433
 
 
2434
2429
# Use a an empty dict to initialize an empty configobj avoiding all
2435
2430
# parsing and encoding checks
2436
2431
_list_converter_config = configobj.ConfigObj(
2533
2528
    Option('default_format', default='2a',
2534
2529
           help='Format used when creating branches.'))
2535
2530
option_registry.register(
2536
 
    Option('dpush_strict', default=None,
2537
 
           from_unicode=bool_from_store,
2538
 
           help='''\
2539
 
The default value for ``dpush --strict``.
2540
 
 
2541
 
If present, defines the ``--strict`` option default value for checking
2542
 
uncommitted changes before pushing into a different VCS without any
2543
 
custom bzr metadata.
2544
 
'''))
2545
 
option_registry.register(
2546
2531
    Option('editor',
2547
2532
           help='The command called to launch an editor to enter a message.'))
2548
2533
option_registry.register(
2573
2558
           help= 'Unicode encoding for output'
2574
2559
           ' (terminal encoding if not specified).'))
2575
2560
option_registry.register(
2576
 
    Option('push_strict', default=None,
2577
 
           from_unicode=bool_from_store,
2578
 
           help='''\
2579
 
The default value for ``push --strict``.
2580
 
 
2581
 
If present, defines the ``--strict`` option default value for checking
2582
 
uncommitted changes before sending a merge directive.
2583
 
'''))
2584
 
option_registry.register(
2585
2561
    Option('repository.fdatasync', default=True,
2586
2562
           from_unicode=bool_from_store,
2587
2563
           help='''\
2591
2567
to physical disk.  This is somewhat slower, but means data should not be
2592
2568
lost if the machine crashes.  See also dirstate.fdatasync.
2593
2569
'''))
2594
 
option_registry.register(
2595
 
    Option('send_strict', default=None,
2596
 
           from_unicode=bool_from_store,
2597
 
           help='''\
2598
 
The default value for ``send --strict``.
2599
 
 
2600
 
If present, defines the ``--strict`` option default value for checking
2601
 
uncommitted changes before pushing.
2602
 
'''))
2603
 
 
2604
 
option_registry.register(
2605
 
    Option('serve.client_timeout',
2606
 
           default=300.0, from_unicode=float_from_store,
2607
 
           help="If we wait for a new request from a client for more than"
2608
 
                " X seconds, consider the client idle, and hangup."))
2609
2570
 
2610
2571
 
2611
2572
class Section(object):