Rev 5746: The option is either new or has an existing value. in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Apr 1 12:40:07 UTC 2011


At file:///home/vila/src/bzr/experimental/config/

------------------------------------------------------------
revno: 5746
revision-id: v.ladeuil+lp at free.fr-20110401124007-roed104ewtmqsovy
parent: v.ladeuil+lp at free.fr-20110401105601-b8bkyiz4q2jdybme
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-section
timestamp: Fri 2011-04-01 14:40:07 +0200
message:
  The option is either new or has an existing value.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-04-01 10:56:01 +0000
+++ b/bzrlib/config.py	2011-04-01 12:40:07 +0000
@@ -2006,9 +2006,11 @@
     def get(self, name, default=None):
         return self.options.get(name, default)
 
+
 _Created = object()
 """Was the option created during the MutableSection lifetime"""
 
+
 class MutableSection(ReadOnlySection):
 
     def __init__(self, section_id, options):
@@ -2017,8 +2019,9 @@
 
     def set(self, name, value):
         if name not in self.options:
+            # This is a new option
             self.orig[name] = _Created
-        if name not in self.orig:
+        elif name not in self.orig:
             self.orig[name] = self.get(name, None)
         self.options[name] = value
 



More information about the bazaar-commits mailing list