Rev 6610: (vila) Revise legal option names to be less drastic. (Vincent Ladeuil) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/

Patch Queue Manager pqm at pqm.ubuntu.com
Thu Jan 21 17:29:45 UTC 2016


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

------------------------------------------------------------
revno: 6610 [merge]
revision-id: pqm at pqm.ubuntu.com-20160121172945-wf8yhqpu1arae3a5
parent: pqm at pqm.ubuntu.com-20160115092149-z5f4sfq3jvaz0enb
parent: v.ladeuil+lp at free.fr-20160121114223-ngcvndi02ydiqs5z
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2016-01-21 17:29:45 +0000
message:
  (vila) Revise legal option names to be less drastic. (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.7.txt bzr2.7.txt-20130727124539-wnx897hy9l2h9f7x-1
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2014-06-19 09:42:08 +0000
+++ b/bzrlib/config.py	2016-01-21 11:42:23 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2012 Canonical Ltd
+# Copyright (C) 2005-2014, 2016 Canonical Ltd
 #   Authors: Robert Collins <robert.collins at canonical.com>
 #            and others
 #
@@ -2550,7 +2550,7 @@
         return "".join(ret)
 
 
-_option_ref_re = lazy_regex.lazy_compile('({[^\d\W](?:\.\w|\w)*})')
+_option_ref_re = lazy_regex.lazy_compile('({[^\d\W](?:\.\w|-\w|\w)*})')
 """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	2016-01-14 14:10:33 +0000
+++ b/bzrlib/tests/test_config.py	2016-01-21 11:42:23 +0000
@@ -2237,6 +2237,8 @@
         self.assertTrue(self.is_valid('__bar__'))
         self.assertTrue(self.is_valid('a_'))
         self.assertTrue(self.is_valid('a1'))
+        # Don't break bzr-svn for no good reason
+        self.assertTrue(self.is_valid('guessed-layout'))
 
     def test_invalid_names(self):
         self.assertFalse(self.is_valid(' foo'))
@@ -2250,6 +2252,10 @@
         self.assertFalse(self.is_valid('{}'))
         self.assertFalse(self.is_valid('{a}'))
         self.assertFalse(self.is_valid('a\n'))
+        self.assertFalse(self.is_valid('-'))
+        self.assertFalse(self.is_valid('-a'))
+        self.assertFalse(self.is_valid('a-'))
+        self.assertFalse(self.is_valid('a--a'))
 
     def assertSingleGroup(self, reference):
         # the regexp is used with split and as such should match the reference

=== modified file 'doc/en/release-notes/bzr-2.7.txt'
--- a/doc/en/release-notes/bzr-2.7.txt	2016-01-14 14:10:33 +0000
+++ b/doc/en/release-notes/bzr-2.7.txt	2016-01-21 11:42:23 +0000
@@ -39,9 +39,9 @@
 * 'acceptable_keys' from 'bazaar.conf' is now properly handled.
   (Vincent Ladeuil, #1249732)
 
-* Option names are now checked to be valid [dotted] python identifiers. Also
-  ignore invalid references (i.e. using invalid option names) while
-  expanding option values. (Vincent Ladeuil, #1235099)
+* Option names are now checked to be valid identifiers (including embedded
+  dots or hyphens). Also ignore invalid references (i.e. using invalid
+  option names) while expanding option values. (Vincent Ladeuil, #1235099)
 
 * Fix pyrex version checking to be more robust.
   (Andrew Starr-Bochicchio, #1030521 )




More information about the bazaar-commits mailing list