~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Vincent Ladeuil
  • Date: 2014-06-19 09:42:08 UTC
  • mto: This revision was merged to the branch mainline in revision 6598.
  • Revision ID: v.ladeuil+lp@free.fr-20140619094208-a7snh4yvweznkwds
Bzr config should save the changes explicitly when needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
3559
3559
        """
3560
3560
        location_parts = self.location.rstrip('/').split('/')
3561
3561
        store = self.store
3562
 
        sections = []
3563
3562
        # Later sections are more specific, they should be returned first
3564
3563
        for _, section in reversed(list(store.get_sections())):
3565
3564
            if section.id is None:
4246
4245
    def _set_config_option(self, name, value, directory, scope):
4247
4246
        conf = self._get_stack(directory, scope, write_access=True)
4248
4247
        conf.set(name, value)
 
4248
        # Explicitly save the changes
 
4249
        conf.store.save_changes()
4249
4250
 
4250
4251
    def _remove_config_option(self, name, directory, scope):
4251
4252
        if name is None:
4254
4255
        conf = self._get_stack(directory, scope, write_access=True)
4255
4256
        try:
4256
4257
            conf.remove(name)
 
4258
            # Explicitly save the changes
 
4259
            conf.store.save_changes()
4257
4260
        except KeyError:
4258
4261
            raise errors.NoSuchConfigOption(name)
4259
4262