Rev 6352: (vila) '\n' cannot be part of a valid config option reference. (Vincent in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Fri Dec 9 13:48:06 UTC 2011


At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 6352 [merge]
revision-id: pqm at pqm.ubuntu.com-20111209134805-vmudt1kfpmoatf5f
parent: pqm at pqm.ubuntu.com-20111208095102-6ljxixlt57eitazx
parent: v.ladeuil+lp at free.fr-20111209120425-ucpc8l4vjwzrfr7q
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-12-09 13:48:05 +0000
message:
  (vila) '\n' cannot be part of a valid config option reference. (Vincent
   Ladeuil)
modified:
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/tests/test_config.py    testconfig.py-20051011041908-742d0c15d8d8c8eb
  doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-11-29 14:59:18 +0000
+++ b/bzrlib/config.py	2011-12-09 12:04:25 +0000
@@ -3156,7 +3156,7 @@
             yield self.store, section
 
 
-_option_ref_re = lazy_regex.lazy_compile('({[^{}]+})')
+_option_ref_re = lazy_regex.lazy_compile('({[^{}\n]+})')
 """Describes an expandable option reference.
 
 We want to match the most embedded reference first.

=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-11-22 11:50:36 +0000
+++ b/bzrlib/tests/test_config.py	2011-12-09 12:04:25 +0000
@@ -3493,6 +3493,9 @@
                          (False, ''),],
                         '{foo}{bar}')
 
+    def test_newline_in_refs_are_not_matched(self):
+        self.assertRefs([(False, '{\nxx}{xx\n}{{\n}}')], '{\nxx}{xx\n}{{\n}}')
+
 
 class TestStackExpandOptions(tests.TestCaseWithTransport):
 

=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt	2011-12-08 09:24:06 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt	2011-12-09 12:04:25 +0000
@@ -32,6 +32,9 @@
 .. Fixes for situations where bzr would previously crash or give incorrect
    or undesirable results.
 
+* Properly ignore '\n' in an option reference since this cannot be part of a
+  config option identifier. (Vincent Ladeuil, #902125)
+
 Documentation
 *************
 




More information about the bazaar-commits mailing list