Rev 5770: Merge config-section into config-abstract-store in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Apr 8 15:37:01 UTC 2011


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

------------------------------------------------------------
revno: 5770 [merge]
revision-id: v.ladeuil+lp at free.fr-20110408153701-ya47hutq734zh4g8
parent: v.ladeuil+lp at free.fr-20110408132751-a26b02vulul9lx08
parent: v.ladeuil+lp at free.fr-20110408145929-las6n20ari31dtan
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-abstract-store
timestamp: Fri 2011-04-08 17:37:01 +0200
message:
  Merge config-section into config-abstract-store
added:
  doc/developers/configuration.txt configuration.txt-20110408142435-korjxxnskvq44sta-1
modified:
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
  doc/developers/index.txt       index.txt-20070508041241-qznziunkg0nffhiw-1
  doc/en/user-guide/configuring_bazaar.txt configuring_bazaar.t-20071128000722-ncxiua259xwbdbg7-1
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-04-08 13:27:51 +0000
+++ b/bzrlib/config.py	2011-04-08 15:37:01 +0000
@@ -2112,7 +2112,7 @@
         return self.options.get(name, default)
 
 
-_Created = object()
+_NewlyCreatedOption = object()
 """Was the option created during the MutableSection lifetime"""
 
 
@@ -2126,7 +2126,7 @@
     def set(self, name, value):
         if name not in self.options:
             # This is a new option
-            self.orig[name] = _Created
+            self.orig[name] = _NewlyCreatedOption
         elif name not in self.orig:
             self.orig[name] = self.get(name, None)
         self.options[name] = value

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-04-07 09:28:35 +0000
+++ b/bzrlib/tests/test_config.py	2011-04-08 15:37:01 +0000
@@ -1887,7 +1887,7 @@
         # The option didn't exist initially so it we need to keep track of it
         # with a special value
         self.assertTrue('foo' in section.orig)
-        self.assertEquals(config._Created, section.orig['foo'])
+        self.assertEquals(config._NewlyCreatedOption, section.orig['foo'])
 
 
 def get_ConfigObjStore(transport, file_name, content=None):

=== added file 'doc/developers/configuration.txt'
--- a/doc/developers/configuration.txt	1970-01-01 00:00:00 +0000
+++ b/doc/developers/configuration.txt	2011-04-08 14:59:29 +0000
@@ -0,0 +1,23 @@
+Configuring Bazaar
+==================
+
+A configuration option has:
+
+- a name: a valid python identifier (even if it's not used as an
+  identifier in python itself)
+
+- a value: a unicode string
+
+Sections
+--------
+
+Options are grouped into sections which share some properties with the well
+known dict objects:
+
+- the key is the name,
+- you can get, set and remove an option,
+- the value is a unicode string.
+
+MutableSection are needed to set or remove an option, ReadOnlySection should
+be used otherwise.
+

=== modified file 'doc/developers/index.txt'
--- a/doc/developers/index.txt	2011-01-06 06:26:23 +0000
+++ b/doc/developers/index.txt	2011-04-08 14:59:29 +0000
@@ -36,9 +36,10 @@
 .. toctree::
    :maxdepth: 1
 
+   configuration
+   fetch
    transports
    ui
-   fetch
 
 Releasing and Packaging
 =======================

=== modified file 'doc/en/user-guide/configuring_bazaar.txt'
--- a/doc/en/user-guide/configuring_bazaar.txt	2011-02-07 01:39:42 +0000
+++ b/doc/en/user-guide/configuring_bazaar.txt	2011-04-08 14:59:29 +0000
@@ -37,6 +37,24 @@
 which shouldn't be reached by the proxy.  (See
 <http://docs.python.org/library/urllib.html> for more details.)
 
+Various ways to configure
+-------------------------
+
+As shown in the example above, there are various ways to
+configure Bazaar, they all share some common properties though,
+an option has:
+
+- a name which is generally a valid python identifier,
+
+- a value which is a string. In some cases, Bazzar will be able
+  to recognize special values like 'True', 'False' to infer a
+  boolean type, but basically, as a user, you will always specify
+  a value as a string.
+
+Options are grouped in various contexts so their name uniquely
+identify them in this context. When needed, options can be made
+persistent by recording them in a configuration file.
+
 
 Configuration files
 -------------------



More information about the bazaar-commits mailing list