~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/library_state.py

(vila) Rename assertWarns in test_config to avoid clashing with unittest2
 assertWarns. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        # There is no overrides by default, they are set later when the command
77
77
        # arguments are parsed.
78
78
        self.cmdline_overrides = config.CommandLineStore()
 
79
        # No config stores are cached to start with
 
80
        self.config_stores = {} # By url
79
81
        self.started = False
80
82
 
81
83
    def __enter__(self):
106
108
        self.started = True
107
109
 
108
110
    def __exit__(self, exc_type, exc_val, exc_tb):
 
111
        if exc_type is None:
 
112
            # Save config changes
 
113
            for k, store in self.config_stores.iteritems():
 
114
                store.save_changes()
109
115
        self.cleanups.cleanup_now()
110
116
        trace._flush_stdout_stderr()
111
117
        trace._flush_trace()