Merge lp:~vila/bzr/1235099-illegal-option-names into lp:bzr
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Vincent Ladeuil | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 6589 | ||||
Proposed branch: | lp:~vila/bzr/1235099-illegal-option-names | ||||
Merge into: | lp:bzr | ||||
Prerequisite: | lp:~vila/bzr/1235099-prereq | ||||
Diff against target: |
214 lines (+102/-17) 4 files modified
bzrlib/config.py (+27/-16) bzrlib/errors.py (+9/-1) bzrlib/tests/test_config.py (+62/-0) doc/en/release-notes/bzr-2.7.txt (+4/-0) |
||||
To merge this branch: | bzr merge lp:~vila/bzr/1235099-illegal-option-names | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John A Meinel | Approve | ||
Review via email: mp+189262@code.launchpad.net |
Commit message
Stricter checks on configuration option names.
Description of the change
There are several use case where config values expansion fails in unhelpful
ways:
- {1,2} as reported in http://
- When templates are used to produce bash scripts (though that case could be
better addressed by allowing some escape mechanism, I'd rather fix that as
a separate bug).
Unfortunately for readability, I had to move the regexp definition so here
are the old and new ones for clarity:
-_option_ref_re = lazy_regex.
+_option_ref_re = lazy_regex.
I.e. valid python identifier (including dotted ones).
As the bug demonstrate we were allowing some illegal option names in the option values and were giving bad error reporting.
This proposal doesn't change which option names are legal (only invalid references could be used before and led to failures) but give better error messages.
I've made a few cleanup changes in lp:~vila/bzr/1235099-prereq which don't seem worth presenting here.
Seems like a good change to me.