~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/library_state.py

  • Committer: Patch Queue Manager
  • Date: 2012-08-23 14:24:38 UTC
  • mfrom: (6499.3.13 832042-shared-stores)
  • Revision ID: pqm@pqm.ubuntu.com-20120823142438-804xd3yql622ahhp
(vila) Share and cache local config files (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()