'bzr config pqm' does not find "pqm_email" setting
Bug #670251 reported by
Andrew Bennetts
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Vincent Ladeuil |
Bug Description
Consider this output:
$ bzr config pqm
$ bzr config pqm_email
locations:
pqm_email = Canonical PQM <email address hidden>
pqm_email = Canonical PQM <email address hidden>
This surprised me, especially because “bzr config email” did find those settings that “bzr config pqm” couldn't.
It turns out that 'bzr config' uses fnmatch.translate to convert the MATCHING argument to a regex, but that perhaps surprisingly generates regexes that match \Z (end of string) in this case:
>>> fnmatch.
'pqm\\Z(?ms)'
It's possible to workaround this by invoking “bzr config '*pqm*'”, but I think the matching could be improved.
Related branches
lp:~vila/bzr/config-active
- John A Meinel: Approve
-
Diff: 424 lines (+147/-56)5 files modifiedbzrlib/config.py (+62/-23)
bzrlib/tests/blackbox/test_config.py (+69/-18)
bzrlib/tests/test_config.py (+9/-13)
doc/en/release-notes/bzr-2.3.txt (+5/-1)
doc/en/whats-new/whats-new-in-2.3.txt (+2/-1)
tags: | added: config |
Changed in bzr: | |
assignee: | nobody → Vincent Ladeuil (vila) |
Changed in bzr: | |
status: | Confirmed → In Progress |
Changed in bzr: | |
milestone: | none → 2.3b4 |
status: | In Progress → Fix Released |
To post a comment you must log in.
Just to follow up on this, we are currently using "matching_ re.search( )" which seems to want to match any possible substring. However "fnmatch.translate" seems to be changing the regexes into "foo$". Which works really oddly.
For example:
$ bzr config location
locations:
push_location = lp:///~jameinel/bzr
push_location = lp:~jameinel
branch:
parent_location = ../../bzr.dev/
But
$ bzr config push
<empty>
There is an argument that "push" != "*push*". However, if that is what we want, then we should be forcing the matching_re to be "push$" and then using "matching_ re.match( )" rather than search.
Also, from mgz:
(12:28:19 PM) mgz: there was a very similar bug with qbzr on that
(12:28:44 PM) mgz: the fix was adding '*' to the input string.
(12:29:09 PM) mgz: fnmatch.translate behaviour changed at some point.