Merge lp:~jelmer/bzr/split-subsegment into lp:bzr
| Status: | Merged |
|---|---|
| Approved by: | Robert Collins on 2010-05-27 |
| Approved revision: | 5170 |
| Merged at revision: | 5267 |
| Proposed branch: | lp:~jelmer/bzr/split-subsegment |
| Merge into: | lp:bzr |
| Diff against target: |
192 lines (+164/-0) 2 files modified
bzrlib/tests/test_urlutils.py (+92/-0) bzrlib/urlutils.py (+72/-0) |
| To merge this branch: | bzr merge lp:~jelmer/bzr/split-subsegment |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Robert Collins (community) | 2010-04-17 | Needs Fixing on 2010-05-23 | |
| Bazaar Developers | code | 2010-04-29 | Pending |
|
Review via email:
|
|||
Commit Message
This adds {split,
Description of the Change
This adds bzrlib.
| Robert Collins (lifeless) wrote : | # |
| Jelmer Vernooij (jelmer) wrote : | # |
On Mon, 2010-04-19 at 00:54 +0000, Robert Collins wrote:
> I think you would be better calling this 'segment parameters' or something
> like that, and it should take a dict rather than plain strings, I think.
Thanks for the review.
I'm not I understand having a dict rather than a list. What would you
want the dict to use as keys or values?
Cheers,
Jelmer
| Robert Collins (lifeless) wrote : | # |
We're adding parameters to a url; see the urllib API for doing that for
existing API's. it also got rehashed on python-dev just recently.
Basically, the API you're proposing has users do the parameter serialisation
themselves, its ugly ;)
| Jelmer Vernooij (jelmer) wrote : | # |
Updated, added a separate function that does the parameter handling.
| Robert Collins (lifeless) wrote : | # |
Further - and final.
Please test:
",foo=bar" etc
"foo/,foo=bar" etc
"foo/base,
Please make the shortest functions the ones taking and returning dicts; and the others to be _raw or something; with a note in the docstring that they are lower level functions.
- 5168. By Jelmer Vernooij on 2010-05-14
-
rename {split,
join}_subsegmen ts -> {split, join}_segment_ parameters_ raw and add more tests.
| Robert Collins (lifeless) wrote : | # |
I know I said that that was my final request - I was wrong. Could you please:
use better examples - e.g.
rather than 'branch':'brrr' if you use 'key1':'value1', it will be a bit more obvious to people reading the tests what you expect to happen.
Secondly, in the docstrings for the methods, please make sure that someone reading just the docstring can figure out what the method will do and what they should pass in. E.g. rather than saying 'Dictionary of parameters' say 'Dictionary representing the url segment parameters. Each key:value in the dict is serialised as key=value. Keys and values must both be bytestrings.
And that brings up the hopefully last point - please typecheck that either each key,value is a bytestring, or that str(key) and str(value) is a bytestring [depending on whether you want to permit passing in objects with a __str__, or only actual strings.
Cheers,
Rob
- 5169. By Jelmer Vernooij on 2010-05-27
-
Fix example names in tests.
- 5170. By Jelmer Vernooij on 2010-05-27
-
Add type checking.

I think you would be better calling this 'segment parameters' or something
like that, and it should take a dict rather than plain strings, I think.