~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Shannon Weyrick
  • Date: 2011-11-04 13:40:04 UTC
  • mfrom: (6238 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6256.
  • Revision ID: weyrick@mozek.us-20111104134004-033t2wqhc3ydzm0a
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
from bzrlib import (
89
89
    atomicfile,
90
 
    bzrdir,
 
90
    controldir,
91
91
    debug,
92
92
    errors,
93
93
    lazy_regex,
 
94
    library_state,
94
95
    lockdir,
95
96
    mail_client,
96
97
    mergetools,
2571
2572
Otherwise, bzr will prompt as normal to break the lock.
2572
2573
'''))
2573
2574
option_registry.register(
 
2575
    Option('log_format', default='long',
 
2576
           help= '''\
 
2577
Log format to use when displaying revisions.
 
2578
 
 
2579
Standard log formats are ``long``, ``short`` and ``line``. Additional formats
 
2580
may be provided by plugins.
 
2581
'''))
 
2582
option_registry.register(
2574
2583
    Option('output_encoding',
2575
2584
           help= 'Unicode encoding for output'
2576
2585
           ' (terminal encoding if not specified).'))
3271
3280
        # Mostly for debugging use
3272
3281
        return "<config.%s(%s)>" % (self.__class__.__name__, id(self))
3273
3282
 
 
3283
    def _get_overrides(self):
 
3284
        # Hack around library_state.initialize never called
 
3285
        if bzrlib.global_state is not None:
 
3286
            return [bzrlib.global_state.cmdline_overrides]
 
3287
        return []
 
3288
 
3274
3289
 
3275
3290
class _CompatibleStack(Stack):
3276
3291
    """Place holder for compatibility with previous design.
3303
3318
        # Get a GlobalStore
3304
3319
        gstore = GlobalStore()
3305
3320
        super(GlobalStack, self).__init__(
3306
 
            [bzrlib.global_state.cmdline_overrides, gstore.get_sections],
 
3321
            [self._get_overrides, gstore.get_sections],
3307
3322
            gstore)
3308
3323
 
3309
3324
 
3318
3333
        matcher = LocationMatcher(lstore, location)
3319
3334
        gstore = GlobalStore()
3320
3335
        super(LocationStack, self).__init__(
3321
 
            [bzrlib.global_state.cmdline_overrides,
 
3336
            [self._get_overrides,
3322
3337
             matcher.get_sections, gstore.get_sections],
3323
3338
            lstore)
3324
3339
 
3332
3347
        matcher = LocationMatcher(lstore, branch.base)
3333
3348
        gstore = GlobalStore()
3334
3349
        super(BranchStack, self).__init__(
3335
 
            [bzrlib.global_state.cmdline_overrides,
 
3350
            [self._get_overrides,
3336
3351
             matcher.get_sections, bstore.get_sections, gstore.get_sections],
3337
3352
            bstore)
3338
3353
        self.branch = branch
3438
3453
            elif scope == 'locations':
3439
3454
                yield LocationConfig(directory)
3440
3455
            elif scope == 'branch':
3441
 
                (_, br, _) = bzrdir.BzrDir.open_containing_tree_or_branch(
3442
 
                    directory)
 
3456
                (_, br, _) = (
 
3457
                    controldir.ControlDir.open_containing_tree_or_branch(
 
3458
                        directory))
3443
3459
                yield br.get_config()
3444
3460
        else:
3445
3461
            try:
3446
 
                (_, br, _) = bzrdir.BzrDir.open_containing_tree_or_branch(
3447
 
                    directory)
 
3462
                (_, br, _) = (
 
3463
                    controldir.ControlDir.open_containing_tree_or_branch(
 
3464
                        directory))
3448
3465
                yield br.get_config()
3449
3466
            except errors.NotBranchError:
3450
3467
                yield LocationConfig(directory)