~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/library_state.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-29 16:16:31 UTC
  • mfrom: (6161.1.6 491196-cmdline-options)
  • Revision ID: pqm@pqm.ubuntu.com-20110929161631-39y752x3cwcljl5w
(vila) Allow configuration options to be overridden from the command line.
 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import sys
24
24
 
25
25
import bzrlib
 
26
from bzrlib.lazy_import import lazy_import
 
27
lazy_import(globals(), """
 
28
from bzrlib import config
 
29
""")
26
30
 
27
31
 
28
32
class BzrLibraryState(object):
61
65
        """
62
66
        self._ui = ui
63
67
        self._trace = trace
 
68
        # There is no overrides by default, they are set later when the command
 
69
        # arguments are parsed.
 
70
        self.cmdline_overrides = config.CommandLineSection()
64
71
        self.started = False
65
72
 
66
73
    def __enter__(self):
69
76
        return self # This is bound to the 'as' clause in a with statement.
70
77
 
71
78
    def _start(self):
72
 
        """Do all initialization.
73
 
        """        
 
79
        """Do all initialization."""
74
80
        # NB: This function tweaks so much global state it's hard to test it in
75
81
        # isolation within the same interpreter.  It's not reached on normal
76
82
        # in-process run_bzr calls.  If it's broken, we expect that