Merge lp:~jelmer/bzr/colo-urls into lp:bzr
| Status: | Rejected |
|---|---|
| Rejected by: | Jelmer Vernooij on 2011-08-15 |
| Proposed branch: | lp:~jelmer/bzr/colo-urls |
| Merge into: | lp:bzr |
| Prerequisite: | lp:~jelmer/bzr/use-branch-open |
| Diff against target: |
778 lines (+247/-89) 13 files modified
bzrlib/branch.py (+45/-11) bzrlib/builtins.py (+38/-35) bzrlib/bzrdir.py (+29/-15) bzrlib/errors.py (+7/-0) bzrlib/reconcile.py (+8/-11) bzrlib/remote.py (+8/-5) bzrlib/switch.py (+1/-1) bzrlib/tests/per_branch/test_branch.py (+2/-1) bzrlib/tests/per_bzrdir_colo/test_unsupported.py (+21/-9) bzrlib/tests/test_branch.py (+37/-0) bzrlib/tests/test_remote.py (+1/-1) bzrlib/tests/test_urlutils.py (+24/-0) bzrlib/urlutils.py (+26/-0) |
| To merge this branch: | bzr merge lp:~jelmer/bzr/colo-urls |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Robert Collins (community) | 2010-04-29 | Needs Fixing on 2010-05-14 | |
| Andrew Bennetts | 2010-03-07 | Needs Information on 2010-03-31 | |
|
Review via email:
|
|||
Description of the Change
Add support for addressing colocated branches using comma's.
| Jelmer Vernooij (jelmer) wrote : | # |
| Andrew Bennetts (spiv) wrote : | # |
My understanding of STD 66 is that commas should bind to path segments, rather than delimit paths entirely, but I'm happy to be corrected if I'm wrong. Also, I don't see any problem with having commas or even slashes in a branch name, that's what percent-encoding is for.
So, if the plan is that ",foo" in a URL indicates a branch name of "foo", then I'd expect URLs to be parsed like:
* http://
* branch location: http://
* branch name: branchname
* http://
* branch location: http://
* branch name: branch,name
* http://
* branch location: http://
* branch name: branchname
* path inside branch: README.txt [e.g. I want to be able to use this with bzr log, bzr cat, and bzr annotate]
I wasn't at Strasbourg. Did we decide against a key/value syntax (like ",branch=name"), or is it still intended that we might support e.g. ",revid=AAAA..." at some point?
(What happened to the promised update to doc/developers/
- 5070. By Jelmer Vernooij on 2010-04-03
-
Add branch name argument in a couple more places.
- 5071. By Jelmer Vernooij on 2010-04-10
-
Fix two test failures.
- 5072. By Jelmer Vernooij on 2010-04-10
-
Merge updated colo spec.
- 5073. By Jelmer Vernooij on 2010-04-11
-
merge colocated branch tests.
- 5074. By Jelmer Vernooij on 2010-04-16
-
Merge more-colo.
- 5075. By Jelmer Vernooij on 2010-04-17
-
merge more-colo
- 5076. By Jelmer Vernooij on 2010-04-17
-
Clarify parsing of subsegments.
- 5077. By Jelmer Vernooij on 2010-04-17
-
Remove unused error.
- 5078. By Jelmer Vernooij on 2010-04-17
-
merge urlutils subsegment improvements.
- 5079. By Jelmer Vernooij on 2010-04-17
-
use new subsegments urlutils functions.
| Martin Pool (mbp) wrote : | # |
I'm still a bit concerned that this is passing the branch name around so many different places, rather than currying that into an object. I guess the problem here is that the places you're updating here are "places a branch could be" not necessarily an existing open branch. Aside from that it looks pretty good, and perhaps it's easier to bring it in and then change it later.
- this_branch.
+ this_branch.
+ other_branch)
Inserting parameters into the middle is a somewhat noxious way to change the api in Python. It's ok to have an api bump but perhaps we should add to the end?
| Robert Collins (lifeless) wrote : | # |
actually this is clearly bogus: other_branch *is a branch object*, there is
no need for the branch name to be there - its known already by the branch
object.
I need to go through this with a fine comb I think, this makes me worry
other changes that aren't needed are being done.
| Vincent Ladeuil (vila) wrote : | # |
@Robert: Did you unpack your comb ? :-)
| Jelmer Vernooij (jelmer) wrote : | # |
Rob, we're setting a branch reference in a local bzrdir to another branch. The name of the local colocated branch is specified by the new parameter.
| Robert Collins (lifeless) wrote : | # |
Am looking at this, iz not forgotten.
| Robert Collins (lifeless) wrote : | # |
Oh, and @spiv - yes, , should be per segment in the path, not whole-string - thats the point of this ;)
| Robert Collins (lifeless) wrote : | # |
Ok, some notes:
- if we have to edit the url before passing to transport, transport isn't supporting segment parameters properly - need some tests on that layer
e.g. opening foo and foo,name=bar should get two equal transports. (except for parameters we decide transports should support - e.g. passive ftp might be one (though we have a syntax for that already)
So - further discussion:
- Transport is our 'access a url' abstraction; it should take care of getting parameters parsed, exposing the parsed parameters to BzrDir.
- BzrDir should get the default branch from the transport parameters.
- other code shouldn't need to change for this part of the conversion
- we should end up being able to open '/foo/bar,name=gam' as a result ! (without changing all the higher layers).
Unmerged revisions
- 5079. By Jelmer Vernooij on 2010-04-17
-
use new subsegments urlutils functions.
- 5078. By Jelmer Vernooij on 2010-04-17
-
merge urlutils subsegment improvements.
- 5077. By Jelmer Vernooij on 2010-04-17
-
Remove unused error.
- 5076. By Jelmer Vernooij on 2010-04-17
-
Clarify parsing of subsegments.
- 5075. By Jelmer Vernooij on 2010-04-17
-
merge more-colo
- 5074. By Jelmer Vernooij on 2010-04-16
-
Merge more-colo.
- 5073. By Jelmer Vernooij on 2010-04-11
-
merge colocated branch tests.
- 5072. By Jelmer Vernooij on 2010-04-10
-
Merge updated colo spec.
- 5071. By Jelmer Vernooij on 2010-04-10
-
Fix two test failures.
- 5070. By Jelmer Vernooij on 2010-04-03
-
Add branch name argument in a couple more places.

This is ready but I'd be interested to hear how we should handle comma's in URLs. I think it's reasonable to require that colocated branch names never can contain a comma in a URL.