Rev 6395: Display [DEFAULT] when reporting options from bazaar.conf. in file:///home/vila/src/bzr/bugs/907268-bazaar-DEFAULT/

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Dec 21 10:56:15 UTC 2011


At file:///home/vila/src/bzr/bugs/907268-bazaar-DEFAULT/

------------------------------------------------------------
revno: 6395
revision-id: v.ladeuil+lp at free.fr-20111221105543-k2e6t3d001vy84h1
parent: v.ladeuil+lp at free.fr-20111221105152-1xdfd4lmx33pu8aq
fixes bug: https://launchpad.net/bugs/907268
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 907268-bazaar-DEFAULT
timestamp: Wed 2011-12-21 11:55:43 +0100
message:
  Display [DEFAULT] when reporting options from bazaar.conf.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-12-21 10:42:34 +0000
+++ b/bzrlib/config.py	2011-12-21 10:55:43 +0000
@@ -3826,10 +3826,10 @@
                             self.outf.write('%s:\n' % (store.id,))
                             cur_store_id = store.id
                             cur_section = None
-                        if (section.id not in (None, 'DEFAULT')
+                        if (section.id is not None
                             and cur_section != section.id):
-                            # Display the section if it's not the default (or
-                            # only) one.
+                            # Display the section id as it appears in the store
+                            # (None doesn't appear by definition)
                             self.outf.write('  [%s]\n' % (section.id,))
                             cur_section = section.id
                         value = section.get(oname, expand=False)

=== modified file 'bzrlib/tests/blackbox/test_config.py'
--- a/bzrlib/tests/blackbox/test_config.py	2011-12-21 08:52:41 +0000
+++ b/bzrlib/tests/blackbox/test_config.py	2011-12-21 10:55:43 +0000
@@ -79,6 +79,7 @@
         script.run_script(self, '''\
             $ bzr config -d tree
             bazaar:
+              [DEFAULT]
               multiline = """1
             2
             """
@@ -101,6 +102,7 @@
         script.run_script(self, '''\
             $ bzr config -d tree
             bazaar:
+              [DEFAULT]
               list = 1, a, "with, a comma"
             ''')
 
@@ -118,6 +120,7 @@
         script.run_script(self, '''\
             $ bzr config -d tree
             bazaar:
+              [DEFAULT]
               hello = world
             ''')
 
@@ -139,6 +142,7 @@
         script.run_script(self, '''\
             $ bzr config
             bazaar:
+              [DEFAULT]
               hello = world
             ''')
 
@@ -214,6 +218,7 @@
             $ bzr config --scope bazaar hello=world
             $ bzr config -d tree --all hello
             bazaar:
+              [DEFAULT]
               hello = world
             ''')
 
@@ -222,6 +227,7 @@
             $ bzr config -d tree --scope bazaar hello=world
             $ bzr config -d tree --all hello
             bazaar:
+              [DEFAULT]
               hello = world
             ''')
 
@@ -290,6 +296,7 @@
             branch:
               file = branch
             bazaar:
+              [DEFAULT]
               file = bazaar
             ''')
 
@@ -300,12 +307,14 @@
             branch:
               file = branch
             bazaar:
+              [DEFAULT]
               file = bazaar
             ''')
         script.run_script(self, '''\
             $ bzr config -d tree --remove file
             $ bzr config -d tree --all file
             bazaar:
+              [DEFAULT]
               file = bazaar
             ''')
 
@@ -317,12 +326,14 @@
               [.../work/tree]
               file = locations
             bazaar:
+              [DEFAULT]
               file = bazaar
             ''')
         script.run_script(self, '''\
             $ bzr config -d tree --scope locations --remove file
             $ bzr config -d tree --all file
             bazaar:
+              [DEFAULT]
               file = bazaar
             ''')
 

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-12-21 10:42:34 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-12-21 10:55:43 +0000
@@ -53,6 +53,9 @@
 * Allow configuration option default value to be a python callable at
   registration. (Vincent Ladeuil, #832064)
 
+* ``bzr config`` will now display the section ``[DEFAULT]`` used in
+  ``bazaar.conf``. (Vincent Ladeuil, #907268)
+
 * Configuration stores can now provides a specific quoting mechanism. This
   is required to workaround ``configobj`` conflating quoting and list values
   automatic conversion. (Vincent Ladeuil, #906897)



More information about the bazaar-commits mailing list