Merge lp:~vila/bzr/609186-shortcuts into lp:bzr
- 609186-shortcuts
- Merge into bzr.dev
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Vincent Ladeuil | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 5486 | ||||
Proposed branch: | lp:~vila/bzr/609186-shortcuts | ||||
Merge into: | lp:bzr | ||||
Prerequisite: | lp:~barry/bzr/609186-shortcuts | ||||
Diff against target: |
260 lines (+50/-99) 3 files modified
NEWS (+7/-7) bzrlib/plugins/launchpad/lp_directory.py (+7/-7) bzrlib/plugins/launchpad/test_lp_directory.py (+36/-85) |
||||
To merge this branch: | bzr merge lp:~vila/bzr/609186-shortcuts | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
bzr-core | Pending | ||
Review via email: mp+38098@code.launchpad.net |
Commit message
Add ubuntu: and debianlp: shortcuts
Description of the change
Adding a test helper on top of Barry's proposal.
Vincent Ladeuil (vila) wrote : | # |
Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
John A Meinel (jameinel) wrote : | # |
sent to pqm by email
Vincent Ladeuil (vila) wrote : | # |
Help needed !
It seems that pqm fails some tests (I briefly saw in a summary ~36 failures mentioned) but the email can't reach me. Investigating with a losa seem to point at my ISP marking it as spam :(
I can reproduce the failures even on the hardy babune slave, so I need someone else to feed-pqm this and forward me the pqm email on my canonical address (<my nick> at canonical <dot> com).
Thanks in advance !
If you get a 'Conflict in NEWS' error, that's not the one I'm after, it just means someone landed some more stuff. I just remerge against trunk though so it shouldn't occur again.
Martin Pool (mbp) wrote : | # |
sent to pqm by email
Martin Pool (mbp) wrote : | # |
I resolved the conflicts in
https:/
I'll let you know if there are any errors.
Martin Pool (mbp) wrote : | # |
There are multiple failures like this:
Traceback (most recent call last):
File "/usr/lib/
return fn(*args)
File "/usr/lib/
testMethod()
File "/home/
self.
File "/home/
self.
File "/home/
if result.scheme in ('ubuntu', 'debianlp'):
AttributeError: 'tuple' object has no attribute 'scheme'
Vincent Ladeuil (vila) wrote : | # |
Bah, the babune slave doesn't force the use of python2.4 so I was on the wrong track.
@barry: You will copy 100 times: bzr should remain compatible with python2.4 OR send me a beer ;)
Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email
Preview Diff
1 | === modified file 'NEWS' | |||
2 | --- NEWS 2010-10-12 07:24:49 +0000 | |||
3 | +++ NEWS 2010-10-12 07:24:50 +0000 | |||
4 | @@ -16,6 +16,13 @@ | |||
5 | 16 | New Features | 16 | New Features |
6 | 17 | ************ | 17 | ************ |
7 | 18 | 18 | ||
8 | 19 | * New shortcut url schemes ``ubuntu:`` and ``debianlp:`` access source | ||
9 | 20 | branches on Launchpad. E.g. ``bzr branch ubuntu:foo`` gives you the source | ||
10 | 21 | branch for project ``foo`` in the current distroseries for Ubuntu while | ||
11 | 22 | ``bzr branch debianlp:lenny/foo`` gives you the source branch (on Launchpad) | ||
12 | 23 | for project ``foo`` in Debian Lenny. | ||
13 | 24 | (Barry Warsaw, #609186) | ||
14 | 25 | |||
15 | 19 | * Provide a configuration option "default_format" that controls the | 26 | * Provide a configuration option "default_format" that controls the |
16 | 20 | default format for new branches created with ``bzr init``. | 27 | default format for new branches created with ``bzr init``. |
17 | 21 | (Neil Martinsen-Burrell, #484101) | 28 | (Neil Martinsen-Burrell, #484101) |
18 | @@ -66,13 +73,6 @@ | |||
19 | 66 | New Features | 73 | New Features |
20 | 67 | ************ | 74 | ************ |
21 | 68 | 75 | ||
22 | 69 | * New shortcut url schemes ``ubuntu:`` and ``debianlp:`` access source | ||
23 | 70 | branches on Launchpad. E.g. ``bzr branch ubuntu:foo`` gives you the source | ||
24 | 71 | branch for project ``foo`` in the current distroseries for Ubuntu while | ||
25 | 72 | ``bzr branch debianlp:lenny/foo`` gives you the source branch (on Launchpad) | ||
26 | 73 | for project ``foo`` in Debian Lenny. | ||
27 | 74 | (Barry Warsaw, #609186) | ||
28 | 75 | |||
29 | 76 | * Add ``mainline`` revision specifier, which selects the revision that | 76 | * Add ``mainline`` revision specifier, which selects the revision that |
30 | 77 | merged a specified revision into the mainline. (Aaron Bentley) | 77 | merged a specified revision into the mainline. (Aaron Bentley) |
31 | 78 | 78 | ||
32 | 79 | 79 | ||
33 | === modified file 'bzrlib/plugins/launchpad/lp_directory.py' | |||
34 | --- bzrlib/plugins/launchpad/lp_directory.py 2010-10-12 07:24:49 +0000 | |||
35 | +++ bzrlib/plugins/launchpad/lp_directory.py 2010-10-12 07:24:50 +0000 | |||
36 | @@ -73,12 +73,12 @@ | |||
37 | 73 | _lp_login=None): | 73 | _lp_login=None): |
38 | 74 | """Resolve the base URL for this transport.""" | 74 | """Resolve the base URL for this transport.""" |
39 | 75 | # Do ubuntu: and debianlp: expansions. | 75 | # Do ubuntu: and debianlp: expansions. |
43 | 76 | result = urlsplit(url) | 76 | scheme, netloc, path, query, fragment = urlsplit(url) |
44 | 77 | if result.scheme in ('ubuntu', 'debianlp'): | 77 | if scheme in ('ubuntu', 'debianlp'): |
45 | 78 | if result.scheme == 'ubuntu': | 78 | if scheme == 'ubuntu': |
46 | 79 | distro = 'ubuntu' | 79 | distro = 'ubuntu' |
47 | 80 | distro_series = _ubuntu_series_shortcuts | 80 | distro_series = _ubuntu_series_shortcuts |
49 | 81 | elif result.scheme == 'debianlp': | 81 | elif scheme == 'debianlp': |
50 | 82 | distro = 'debian' | 82 | distro = 'debian' |
51 | 83 | # No shortcuts for Debian distroseries. | 83 | # No shortcuts for Debian distroseries. |
52 | 84 | distro_series = {} | 84 | distro_series = {} |
53 | @@ -87,7 +87,7 @@ | |||
54 | 87 | # Split the path. It's either going to be 'project' or | 87 | # Split the path. It's either going to be 'project' or |
55 | 88 | # 'series/project', but recognize that it may be a series we don't | 88 | # 'series/project', but recognize that it may be a series we don't |
56 | 89 | # know about. | 89 | # know about. |
58 | 90 | path_parts = result.path.split('/') | 90 | path_parts = path.split('/') |
59 | 91 | if len(path_parts) == 1: | 91 | if len(path_parts) == 1: |
60 | 92 | # It's just a project name. | 92 | # It's just a project name. |
61 | 93 | lp_url_template = 'lp:%(distro)s/%(project)s' | 93 | lp_url_template = 'lp:%(distro)s/%(project)s' |
62 | @@ -108,11 +108,11 @@ | |||
63 | 108 | distro=distro, | 108 | distro=distro, |
64 | 109 | series=series, | 109 | series=series, |
65 | 110 | project=project) | 110 | project=project) |
67 | 111 | result = urlsplit(url) | 111 | scheme, netloc, path, query, fragment = urlsplit(url) |
68 | 112 | service = LaunchpadService.for_url(url) | 112 | service = LaunchpadService.for_url(url) |
69 | 113 | if _lp_login is None: | 113 | if _lp_login is None: |
70 | 114 | _lp_login = get_lp_login() | 114 | _lp_login = get_lp_login() |
72 | 115 | path = result[2].strip('/') | 115 | path = path.strip('/') |
73 | 116 | if path.startswith('~/'): | 116 | if path.startswith('~/'): |
74 | 117 | if _lp_login is None: | 117 | if _lp_login is None: |
75 | 118 | raise errors.InvalidURL(path=url, | 118 | raise errors.InvalidURL(path=url, |
76 | 119 | 119 | ||
77 | === modified file 'bzrlib/plugins/launchpad/test_lp_directory.py' | |||
78 | --- bzrlib/plugins/launchpad/test_lp_directory.py 2010-10-12 07:24:49 +0000 | |||
79 | +++ bzrlib/plugins/launchpad/test_lp_directory.py 2010-10-12 07:24:50 +0000 | |||
80 | @@ -375,6 +375,13 @@ | |||
81 | 375 | self, path, dict(urls=[ | 375 | self, path, dict(urls=[ |
82 | 376 | 'http://bazaar.launchpad.net/' + url_suffix])) | 376 | 'http://bazaar.launchpad.net/' + url_suffix])) |
83 | 377 | 377 | ||
84 | 378 | def assertURL(self, expected_url, shortcut, package='foo', distro='ubuntu', | ||
85 | 379 | series=None): | ||
86 | 380 | factory = self._make_factory(package=package, distro=distro, | ||
87 | 381 | series=series) | ||
88 | 382 | self.assertEqual('http://bazaar.launchpad.net/~branch/' + expected_url, | ||
89 | 383 | self.directory._resolve(shortcut, factory)) | ||
90 | 384 | |||
91 | 378 | # Bogus distro. | 385 | # Bogus distro. |
92 | 379 | 386 | ||
93 | 380 | def test_bogus_distro(self): | 387 | def test_bogus_distro(self): |
94 | @@ -392,137 +399,81 @@ | |||
95 | 392 | def test_missing_ubuntu_distroseries_without_project(self): | 399 | def test_missing_ubuntu_distroseries_without_project(self): |
96 | 393 | # Launchpad does not hold source packages for Intrepid. Missing or | 400 | # Launchpad does not hold source packages for Intrepid. Missing or |
97 | 394 | # bogus distroseries with no project name is treated like a project. | 401 | # bogus distroseries with no project name is treated like a project. |
102 | 395 | factory = self._make_factory(package='intrepid') | 402 | self.assertURL('ubuntu/intrepid', 'ubuntu:intrepid', package='intrepid') |
99 | 396 | self.assertEqual( | ||
100 | 397 | 'http://bazaar.launchpad.net/~branch/ubuntu/intrepid', | ||
101 | 398 | self.directory._resolve('ubuntu:intrepid', factory)) | ||
103 | 399 | 403 | ||
104 | 400 | def test_missing_ubuntu_distroseries_with_project(self): | 404 | def test_missing_ubuntu_distroseries_with_project(self): |
105 | 401 | # Launchpad does not hold source packages for Intrepid. Missing or | 405 | # Launchpad does not hold source packages for Intrepid. Missing or |
106 | 402 | # bogus distroseries with a project name is treated like an unknown | 406 | # bogus distroseries with a project name is treated like an unknown |
107 | 403 | # series (i.e. we keep it verbatim). | 407 | # series (i.e. we keep it verbatim). |
112 | 404 | factory = self._make_factory(series='intrepid') | 408 | self.assertURL('ubuntu/intrepid/foo', |
113 | 405 | self.assertEqual( | 409 | 'ubuntu:intrepid/foo', series='intrepid') |
110 | 406 | 'http://bazaar.launchpad.net/~branch/ubuntu/intrepid/foo', | ||
111 | 407 | self.directory._resolve('ubuntu:intrepid/foo', factory)) | ||
114 | 408 | 410 | ||
115 | 409 | def test_missing_debian_distroseries(self): | 411 | def test_missing_debian_distroseries(self): |
116 | 410 | # Launchpad does not hold source packages for unstable. Missing or | 412 | # Launchpad does not hold source packages for unstable. Missing or |
117 | 411 | # bogus distroseries is treated like a project. | 413 | # bogus distroseries is treated like a project. |
122 | 412 | factory = self._make_factory(package='sid', distro='debian') | 414 | self.assertURL('debian/sid', |
123 | 413 | self.assertEqual( | 415 | 'debianlp:sid', package='sid', distro='debian') |
120 | 414 | 'http://bazaar.launchpad.net/~branch/debian/sid', | ||
121 | 415 | self.directory._resolve('debianlp:sid', factory)) | ||
124 | 416 | 416 | ||
125 | 417 | # Ubuntu Default distro series. | 417 | # Ubuntu Default distro series. |
126 | 418 | 418 | ||
127 | 419 | def test_ubuntu_default_distroseries_expansion(self): | 419 | def test_ubuntu_default_distroseries_expansion(self): |
131 | 420 | factory = self._make_factory(package='foo') | 420 | self.assertURL('ubuntu/foo', 'ubuntu:foo') |
129 | 421 | self.assertEqual('http://bazaar.launchpad.net/~branch/ubuntu/foo', | ||
130 | 422 | self.directory._resolve('ubuntu:foo', factory)), | ||
132 | 423 | 421 | ||
133 | 424 | def test_ubuntu_natty_distroseries_expansion(self): | 422 | def test_ubuntu_natty_distroseries_expansion(self): |
138 | 425 | factory = self._make_factory(package='foo', series='natty') | 423 | self.assertURL('ubuntu/natty/foo', 'ubuntu:natty/foo', series='natty') |
135 | 426 | self.assertEqual( | ||
136 | 427 | 'http://bazaar.launchpad.net/~branch/ubuntu/natty/foo', | ||
137 | 428 | self.directory._resolve('ubuntu:natty/foo', factory)), | ||
139 | 429 | 424 | ||
140 | 430 | def test_ubuntu_n_distroseries_expansion(self): | 425 | def test_ubuntu_n_distroseries_expansion(self): |
145 | 431 | factory = self._make_factory(package='foo', series='natty') | 426 | self.assertURL('ubuntu/natty/foo', 'ubuntu:n/foo', series='natty') |
142 | 432 | self.assertEqual( | ||
143 | 433 | 'http://bazaar.launchpad.net/~branch/ubuntu/natty/foo', | ||
144 | 434 | self.directory._resolve('ubuntu:n/foo', factory)), | ||
146 | 435 | 427 | ||
147 | 436 | def test_ubuntu_maverick_distroseries_expansion(self): | 428 | def test_ubuntu_maverick_distroseries_expansion(self): |
152 | 437 | factory = self._make_factory(package='foo', series='maverick') | 429 | self.assertURL('ubuntu/maverick/foo', 'ubuntu:maverick/foo', |
153 | 438 | self.assertEqual( | 430 | series='maverick') |
150 | 439 | 'http://bazaar.launchpad.net/~branch/ubuntu/maverick/foo', | ||
151 | 440 | self.directory._resolve('ubuntu:maverick/foo', factory)), | ||
154 | 441 | 431 | ||
155 | 442 | def test_ubuntu_m_distroseries_expansion(self): | 432 | def test_ubuntu_m_distroseries_expansion(self): |
160 | 443 | factory = self._make_factory(package='foo', series='maverick') | 433 | self.assertURL('ubuntu/maverick/foo', 'ubuntu:m/foo', series='maverick') |
157 | 444 | self.assertEqual( | ||
158 | 445 | 'http://bazaar.launchpad.net/~branch/ubuntu/maverick/foo', | ||
159 | 446 | self.directory._resolve('ubuntu:m/foo', factory)), | ||
161 | 447 | 434 | ||
162 | 448 | def test_ubuntu_lucid_distroseries_expansion(self): | 435 | def test_ubuntu_lucid_distroseries_expansion(self): |
167 | 449 | factory = self._make_factory(package='foo', series='lucid') | 436 | self.assertURL('ubuntu/lucid/foo', 'ubuntu:lucid/foo', series='lucid') |
164 | 450 | self.assertEqual( | ||
165 | 451 | 'http://bazaar.launchpad.net/~branch/ubuntu/lucid/foo', | ||
166 | 452 | self.directory._resolve('ubuntu:lucid/foo', factory)), | ||
168 | 453 | 437 | ||
169 | 454 | def test_ubuntu_l_distroseries_expansion(self): | 438 | def test_ubuntu_l_distroseries_expansion(self): |
174 | 455 | factory = self._make_factory(package='foo', series='lucid') | 439 | self.assertURL('ubuntu/lucid/foo', 'ubuntu:l/foo', series='lucid') |
171 | 456 | self.assertEqual( | ||
172 | 457 | 'http://bazaar.launchpad.net/~branch/ubuntu/lucid/foo', | ||
173 | 458 | self.directory._resolve('ubuntu:l/foo', factory)), | ||
175 | 459 | 440 | ||
176 | 460 | def test_ubuntu_karmic_distroseries_expansion(self): | 441 | def test_ubuntu_karmic_distroseries_expansion(self): |
181 | 461 | factory = self._make_factory(package='foo', series='karmic') | 442 | self.assertURL('ubuntu/karmic/foo', 'ubuntu:karmic/foo', |
182 | 462 | self.assertEqual( | 443 | series='karmic') |
179 | 463 | 'http://bazaar.launchpad.net/~branch/ubuntu/karmic/foo', | ||
180 | 464 | self.directory._resolve('ubuntu:karmic/foo', factory)), | ||
183 | 465 | 444 | ||
184 | 466 | def test_ubuntu_k_distroseries_expansion(self): | 445 | def test_ubuntu_k_distroseries_expansion(self): |
189 | 467 | factory = self._make_factory(package='foo', series='karmic') | 446 | self.assertURL('ubuntu/karmic/foo', 'ubuntu:k/foo', series='karmic') |
186 | 468 | self.assertEqual( | ||
187 | 469 | 'http://bazaar.launchpad.net/~branch/ubuntu/karmic/foo', | ||
188 | 470 | self.directory._resolve('ubuntu:k/foo', factory)), | ||
190 | 471 | 447 | ||
191 | 472 | def test_ubuntu_jaunty_distroseries_expansion(self): | 448 | def test_ubuntu_jaunty_distroseries_expansion(self): |
196 | 473 | factory = self._make_factory(package='foo', series='jaunty') | 449 | self.assertURL('ubuntu/jaunty/foo', 'ubuntu:jaunty/foo', |
197 | 474 | self.assertEqual( | 450 | series='jaunty') |
194 | 475 | 'http://bazaar.launchpad.net/~branch/ubuntu/jaunty/foo', | ||
195 | 476 | self.directory._resolve('ubuntu:jaunty/foo', factory)), | ||
198 | 477 | 451 | ||
199 | 478 | def test_ubuntu_j_distroseries_expansion(self): | 452 | def test_ubuntu_j_distroseries_expansion(self): |
204 | 479 | factory = self._make_factory(package='foo', series='jaunty') | 453 | self.assertURL('ubuntu/jaunty/foo', 'ubuntu:j/foo', series='jaunty') |
201 | 480 | self.assertEqual( | ||
202 | 481 | 'http://bazaar.launchpad.net/~branch/ubuntu/jaunty/foo', | ||
203 | 482 | self.directory._resolve('ubuntu:j/foo', factory)), | ||
205 | 483 | 454 | ||
206 | 484 | def test_ubuntu_hardy_distroseries_expansion(self): | 455 | def test_ubuntu_hardy_distroseries_expansion(self): |
211 | 485 | factory = self._make_factory(package='foo', series='hardy') | 456 | self.assertURL('ubuntu/hardy/foo', 'ubuntu:hardy/foo', series='hardy') |
208 | 486 | self.assertEqual( | ||
209 | 487 | 'http://bazaar.launchpad.net/~branch/ubuntu/hardy/foo', | ||
210 | 488 | self.directory._resolve('ubuntu:hardy/foo', factory)), | ||
212 | 489 | 457 | ||
213 | 490 | def test_ubuntu_h_distroseries_expansion(self): | 458 | def test_ubuntu_h_distroseries_expansion(self): |
218 | 491 | factory = self._make_factory(package='foo', series='hardy') | 459 | self.assertURL('ubuntu/hardy/foo', 'ubuntu:h/foo', series='hardy') |
215 | 492 | self.assertEqual( | ||
216 | 493 | 'http://bazaar.launchpad.net/~branch/ubuntu/hardy/foo', | ||
217 | 494 | self.directory._resolve('ubuntu:h/foo', factory)), | ||
219 | 495 | 460 | ||
220 | 496 | def test_ubuntu_dapper_distroseries_expansion(self): | 461 | def test_ubuntu_dapper_distroseries_expansion(self): |
225 | 497 | factory = self._make_factory(package='foo', series='dapper') | 462 | self.assertURL('ubuntu/dapper/foo', 'ubuntu:dapper/foo', |
226 | 498 | self.assertEqual( | 463 | series='dapper') |
223 | 499 | 'http://bazaar.launchpad.net/~branch/ubuntu/dapper/foo', | ||
224 | 500 | self.directory._resolve('ubuntu:dapper/foo', factory)), | ||
227 | 501 | 464 | ||
228 | 502 | def test_ubuntu_d_distroseries_expansion(self): | 465 | def test_ubuntu_d_distroseries_expansion(self): |
233 | 503 | factory = self._make_factory(package='foo', series='dapper') | 466 | self.assertURL('ubuntu/dapper/foo', 'ubuntu:d/foo', series='dapper') |
230 | 504 | self.assertEqual( | ||
231 | 505 | 'http://bazaar.launchpad.net/~branch/ubuntu/dapper/foo', | ||
232 | 506 | self.directory._resolve('ubuntu:d/foo', factory)), | ||
234 | 507 | 467 | ||
235 | 508 | # Debian default distro series. | 468 | # Debian default distro series. |
236 | 509 | 469 | ||
237 | 510 | def test_debian_default_distroseries_expansion(self): | 470 | def test_debian_default_distroseries_expansion(self): |
242 | 511 | factory = self._make_factory(package='foo', distro='debian') | 471 | self.assertURL('debian/foo', 'debianlp:foo', distro='debian') |
239 | 512 | self.assertEqual( | ||
240 | 513 | 'http://bazaar.launchpad.net/~branch/debian/foo', | ||
241 | 514 | self.directory._resolve('debianlp:foo', factory)) | ||
243 | 515 | 472 | ||
244 | 516 | def test_debian_squeeze_distroseries_expansion(self): | 473 | def test_debian_squeeze_distroseries_expansion(self): |
250 | 517 | factory = self._make_factory( | 474 | self.assertURL('debian/squeeze/foo', 'debianlp:squeeze/foo', |
251 | 518 | package='foo', distro='debian', series='squeeze') | 475 | distro='debian', series='squeeze') |
247 | 519 | self.assertEqual( | ||
248 | 520 | 'http://bazaar.launchpad.net/~branch/debian/squeeze/foo', | ||
249 | 521 | self.directory._resolve('debianlp:squeeze/foo', factory)), | ||
252 | 522 | 476 | ||
253 | 523 | def test_debian_lenny_distroseries_expansion(self): | 477 | def test_debian_lenny_distroseries_expansion(self): |
259 | 524 | factory = self._make_factory( | 478 | self.assertURL('debian/lenny/foo', 'debianlp:lenny/foo', |
260 | 525 | package='foo', distro='debian', series='lenny') | 479 | distro='debian', series='lenny') |
256 | 526 | self.assertEqual( | ||
257 | 527 | 'http://bazaar.launchpad.net/~branch/debian/lenny/foo', | ||
258 | 528 | self.directory._resolve('debianlp:lenny/foo', factory)), |
sent to pqm by email