Rev 6598: Bzr config should save the changes explicitly when needed in file:///home/vila/src/bzr/bugs/1331999-test-config-warnings/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Jun 19 09:42:08 UTC 2014
At file:///home/vila/src/bzr/bugs/1331999-test-config-warnings/
------------------------------------------------------------
revno: 6598
revision-id: v.ladeuil+lp at free.fr-20140619094208-a7snh4yvweznkwds
parent: pqm at pqm.ubuntu.com-20140508025629-de62pqrditrp349y
fixes bug: https://launchpad.net/bugs/1331999
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 1331999-test-config-warnings
timestamp: Thu 2014-06-19 11:42:08 +0200
message:
Bzr config should save the changes explicitly when needed
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py 2014-02-14 10:29:49 +0000
+++ b/bzrlib/config.py 2014-06-19 09:42:08 +0000
@@ -3559,7 +3559,6 @@
"""
location_parts = self.location.rstrip('/').split('/')
store = self.store
- sections = []
# Later sections are more specific, they should be returned first
for _, section in reversed(list(store.get_sections())):
if section.id is None:
@@ -4246,6 +4245,8 @@
def _set_config_option(self, name, value, directory, scope):
conf = self._get_stack(directory, scope, write_access=True)
conf.set(name, value)
+ # Explicitly save the changes
+ conf.store.save_changes()
def _remove_config_option(self, name, directory, scope):
if name is None:
@@ -4254,6 +4255,8 @@
conf = self._get_stack(directory, scope, write_access=True)
try:
conf.remove(name)
+ # Explicitly save the changes
+ conf.store.save_changes()
except KeyError:
raise errors.NoSuchConfigOption(name)
=== modified file 'doc/en/release-notes/bzr-2.7.txt'
--- a/doc/en/release-notes/bzr-2.7.txt 2014-05-07 22:20:27 +0000
+++ b/doc/en/release-notes/bzr-2.7.txt 2014-06-19 09:42:08 +0000
@@ -72,6 +72,11 @@
suite. This can include new facilities for writing tests, fixes to
spurious test failures and changes to the way things should be tested.
+* Fix warnings on stderr caused by the atexit handler triggering for the
+ wrong reason: the 'config' command should explicitly save the changes when
+ modifying or removing an option and not rely on the atexit
+ handler. (Vincent Ladeuil, #1331999)
+
* Handle (minor) incompatible change in python 2.7.6 leading to test
failures. Only tests are affected. (Vincent Ladeuil, #1303879)
More information about the bazaar-commits
mailing list