Merge lp:~vila/bzr/832046-globs-store-ordered into lp:bzr
| Status: | Merged |
|---|---|
| Approved by: | Martin Packman on 2012-01-05 |
| Approved revision: | 6411 |
| Merged at revision: | 6437 |
| Proposed branch: | lp:~vila/bzr/832046-globs-store-ordered |
| Merge into: | lp:bzr |
| Diff against target: |
304 lines (+163/-21) (has conflicts) 4 files modified
bzrlib/config.py (+62/-10) bzrlib/tests/test_config.py (+87/-8) doc/developers/configuration.txt (+6/-3) doc/en/release-notes/bzr-2.5.txt (+8/-0) Text conflict in doc/en/release-notes/bzr-2.5.txt |
| To merge this branch: | bzr merge lp:~vila/bzr/832046-globs-store-ordered |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Martin Packman (community) | Approve on 2012-01-05 | ||
| Jelmer Vernooij (community) | 2011-12-22 | Abstain on 2012-01-03 | |
|
Review via email:
|
|||
Commit Message
Provide a config section matcher respecting the file order.
Description of the Change
This fixes http://
respect the order specified by the user in the file.
That's the matcher I want to use for the new config files (defaults,
system-wide, etc) instead of locations.conf for which the order is less
predictable.
Once http://
about https:/
which could then be taken into account.
| Vincent Ladeuil (vila) wrote : | # |
| Jelmer Vernooij (jelmer) wrote : | # |
Rather than this:
55 + if location.
56 + location = urlutils.
shouldn't this be using urlutils.
| Vincent Ladeuil (vila) wrote : | # |
> Rather than this:
>
> 55 + if location.
> 56 + location = urlutils.
>
> shouldn't this be using urlutils.
We've been using the same for locations.conf so I'm quite sure it's correct :)
We want to get a local path if possible and unescape_
| Jelmer Vernooij (jelmer) wrote : | # |
On 12/23/2011 08:05 AM, Vincent Ladeuil wrote:
>> Rather than this:
>>
>> 55 + if location.
>> 56 + location = urlutils.
>>
>> shouldn't this be using urlutils.
>
> We've been using the same for locations.conf so I'm quite sure it's
correct :)
>
> We want to get a local path if possible and unescape_
do that AFAIK.
unescape_
now if it was already there, it just seems to duplicate some code
unnecessarily.
Cheers,
Jelmer
| Vincent Ladeuil (vila) wrote : | # |
> unescape_
> now if it was already there, it just seems to duplicate some code
> unnecessarily.
I don't get it, what is duplicated here ?
| Jelmer Vernooij (jelmer) wrote : | # |
> > unescape_
> > now if it was already there, it just seems to duplicate some code
> > unnecessarily.
>
> I don't get it, what is duplicated here ?
The code which converts a URL to a section name in locations.conf, as it seems to be essentially the same thing as urlutils.
This all seems a bit magical - special casing local file paths. I wonder if it would make more sense to just convert everything to normalized URLs (using location_to_url) and then just compare those? That removes the need for special casing, and should also take care of any issues with characters that are e.g. escaped in the locations.conf file and not in the specified URL and vice versa.
| Vincent Ladeuil (vila) wrote : | # |
> > > unescape_
> > > now if it was already there, it just seems to duplicate some code
> > > unnecessarily.
> >
> > I don't get it, what is duplicated here ?
> The code which converts a URL to a section name in locations.conf, as it seems
> to be essentially the same thing as urlutils.
With no encoding involved :-/
>
> This all seems a bit magical - special casing local file paths. I wonder if it
> would make more sense to just convert everything to normalized URLs (using
> location_to_url) and then just compare those?
Well, that's old magic which works, I'd rather not fix it.
> That removes the need for
> special casing, and should also take care of any issues with characters that
> are e.g. escaped in the locations.conf file and not in the specified URL and
> vice versa.
So far, I mimic what is done in locations.conf, we can revisit that for both StartingPathMatcher and LocationMatcher but that seems out of scope for this proposal.
- 6409. By Vincent Ladeuil on 2012-01-03
-
Cleanup a bit and make sure we use at least one file:// url in the tests.
| Vincent Ladeuil (vila) wrote : | # |
To clarify: I looked at using unescape_
| Jelmer Vernooij (jelmer) wrote : | # |
I think at the very least this should have tests for URLs in locations.conf, and for matching local file URLs against paths and vice versa.
| Martin Packman (gz) wrote : | # |
The StartingPathMatcher logic is the confusing part, particularly what 'location' is expected to be. Stating it's inherited from what existing function, and listing limitations would help I think.
Using unescape_
- 6410. By Vincent Ladeuil on 2012-01-04
-
Feedback from review.
- 6411. By Vincent Ladeuil on 2012-01-05
-
Tweak news entry to conflict on merge.
| Martin Packman (gz) wrote : | # |
Changes look good provided the new local_path tests don't break on windows from using nix-style paths.
| Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
| Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
| Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
| Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email

Hit send too fast.
While I was there, I fixed a docstring issue in IniFileStore (which was intended for TransportIniFil eStore) and also added an external_url to IniFileStore or we get weird NotImplemented exceptions when trying to %r such a store during debug.
I'm not sold on the StartingPathMatcher name (which I think capture the most important use case) and used GlobOrderedMatcher in a previous version (which I find uninformative). Suggestions welcome.