Merge lp:~jelmer/brz/lp-check-vcs into lp:brz/3.3
- lp-check-vcs
- Merge into 3.3
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | 7805 |
Merged at revision: | 7801 |
Proposed branch: | lp:~jelmer/brz/lp-check-vcs |
Merge into: | lp:brz/3.3 |
Diff against target: |
529 lines (+83/-355) 6 files modified
Cargo.toml (+1/-1) breezy/git/__init__.py (+19/-2) breezy/plugins/launchpad/lp_api.py (+0/-18) breezy/plugins/launchpad/lp_directory.py (+61/-81) breezy/plugins/launchpad/test_lp_directory.py (+1/-252) lib-rio/Cargo.toml (+1/-1) |
To merge this branch: | bzr merge lp:~jelmer/brz/lp-check-vcs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij | Approve | ||
Review via email: mp+446980@code.launchpad.net |
Commit message
Improve handling of lp: URLs when lp: insteadOf is set in gitconfig
Description of the change
Improve handling of lp: URLs when lp: insteadOf is set in gitconfig:
* Simplify lp: URL resolution, just relying on API rather than local guessing
* Ignore lp: insteadOf when launchpad plugin is loaded
* Support both Git repositories and Bazaar repositories when resolving lp:
* Warn when lp: URL is ambiguous
To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) : | # |
review:
Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
lp:~jelmer/brz/lp-check-vcs
updated
- 7805. By Jelmer Vernooij
-
Drop now irrelevant tests
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Cargo.toml' |
2 | --- Cargo.toml 2023-02-14 02:35:03 +0000 |
3 | +++ Cargo.toml 2023-07-17 17:35:02 +0000 |
4 | @@ -1,6 +1,6 @@ |
5 | [package] |
6 | name = "breezy" |
7 | -version = "3.3.3" |
8 | +version = "3.3.4" |
9 | authors = [ "Martin Packman <gzlist@googlemail.com>", "Jelmer Vernooij <jelmer@jelmer.uk>"] |
10 | edition = "2018" |
11 | publish = false |
12 | |
13 | === modified file 'breezy/git/__init__.py' |
14 | --- breezy/git/__init__.py 2023-01-31 01:05:40 +0000 |
15 | +++ breezy/git/__init__.py 2023-07-17 17:35:02 +0000 |
16 | @@ -264,11 +264,28 @@ |
17 | |
18 | |
19 | def rewrite_instead_of(location, purpose): |
20 | - from dulwich.config import StackedConfig, apply_instead_of |
21 | + from dulwich.config import StackedConfig, iter_instead_of |
22 | |
23 | config = StackedConfig.default() |
24 | |
25 | - return apply_instead_of(config, location, push=(purpose == "push")) |
26 | + push = (purpose != "read") |
27 | + |
28 | + longest_needle = "" |
29 | + updated_url = location |
30 | + for needle, replacement in iter_instead_of(config, push): |
31 | + if not location.startswith(needle): |
32 | + continue |
33 | + if len(longest_needle) < len(needle): |
34 | + longest_needle = needle |
35 | + if longest_needle == "lp:": |
36 | + # Leave the lp: prefix to the launchpad plugin, if loaded |
37 | + import breezy.plugins |
38 | + if hasattr(breezy.plugins, "launchpad"): |
39 | + trace.warning( |
40 | + "Ignoring insteadOf lp: in git config, because the Launchpad plugin is loaded.") |
41 | + continue |
42 | + updated_url = replacement + location[len(needle):] |
43 | + return updated_url |
44 | |
45 | |
46 | from ..location import hooks as location_hooks |
47 | |
48 | === modified file 'breezy/plugins/launchpad/lp_api.py' |
49 | --- breezy/plugins/launchpad/lp_api.py 2023-01-31 01:05:40 +0000 |
50 | +++ breezy/plugins/launchpad/lp_api.py 2023-07-17 17:35:02 +0000 |
51 | @@ -206,24 +206,6 @@ |
52 | '://bazaar.*.launchpad.net') |
53 | return bool(regex.match(url)) |
54 | |
55 | - @staticmethod |
56 | - def candidate_urls(bzr_branch): |
57 | - """Iterate through related URLs that might be Launchpad URLs. |
58 | - |
59 | - :param bzr_branch: A Bazaar branch to find URLs from. |
60 | - :return: a generator of URL strings. |
61 | - """ |
62 | - url = bzr_branch.get_public_branch() |
63 | - if url is not None: |
64 | - yield url |
65 | - url = bzr_branch.get_push_location() |
66 | - if url is not None: |
67 | - yield url |
68 | - url = bzr_branch.get_parent() |
69 | - if url is not None: |
70 | - yield url |
71 | - yield bzr_branch.base |
72 | - |
73 | def get_target(self): |
74 | """Return the 'LaunchpadBranch' for the target of this one.""" |
75 | lp_branch = self.lp |
76 | |
77 | === modified file 'breezy/plugins/launchpad/lp_directory.py' |
78 | --- breezy/plugins/launchpad/lp_directory.py 2023-03-31 15:00:34 +0000 |
79 | +++ breezy/plugins/launchpad/lp_directory.py 2023-07-17 17:35:02 +0000 |
80 | @@ -38,7 +38,7 @@ |
81 | The URL is specified by its parsed components, as returned from |
82 | urlsplit. |
83 | """ |
84 | - return (scheme in ('bzr+ssh', 'sftp') |
85 | + return (scheme in ('bzr+ssh', 'sftp', 'git+ssh') |
86 | and (netloc.endswith('launchpad.net') or |
87 | netloc.endswith('launchpad.test'))) |
88 | |
89 | @@ -64,97 +64,77 @@ |
90 | from .lp_api import connect_launchpad |
91 | lp = connect_launchpad(api_base_url, version='devel') |
92 | subpaths = [] |
93 | + lp_branch = None |
94 | + git_repo = None |
95 | while path: |
96 | lp_branch = lp.branches.getByPath(path=path) |
97 | - if lp_branch: |
98 | + git_repo = lp.git_repositories.getByPath(path=path) |
99 | + if lp_branch and git_repo: |
100 | + target = git_repo.target |
101 | + vcs = target.vcs |
102 | + trace.warning( |
103 | + "Found both a Bazaar branch and a git repository at lp:%s. Using " |
104 | + "%s, since that is the projects' default vcs", path, vcs) |
105 | + if vcs == "Git": |
106 | + lp_branch = None |
107 | + elif vcs == "Bazaar": |
108 | + git_repo = None |
109 | + else: |
110 | + raise errors.BzrError( |
111 | + "Unknown default vcs %s for %s" % (vcs, target)) |
112 | + if lp_branch or git_repo: |
113 | break |
114 | path, subpath = split(path) |
115 | subpaths.insert(0, subpath) |
116 | - if not lp_branch: |
117 | - raise errors.InvalidURL("Unknown Launchpad path: %s" % url) |
118 | - return {'urls': [join(lp_branch.composePublicURL(scheme='bzr+ssh'), *subpaths), |
119 | - join(lp_branch.composePublicURL(scheme='http'), *subpaths)]} |
120 | + if lp_branch: |
121 | + return {'urls': [join(lp_branch.composePublicURL(scheme='bzr+ssh'), *subpaths), |
122 | + join(lp_branch.composePublicURL(scheme='http'), *subpaths)]} |
123 | + elif git_repo: |
124 | + return {'urls': [join(git_repo.git_ssh_url, *subpaths), |
125 | + join(git_repo.git_https_url, *subpaths)]} |
126 | + else: |
127 | + raise InvalidURL(f"Unknown Launchpad path: {url}") |
128 | + |
129 | + |
130 | +def _resolve(url, _lp_login=None): |
131 | + """Resolve the base URL for this transport.""" |
132 | + url, path = _update_url_scheme(url) |
133 | + if _lp_login is None: |
134 | + _lp_login = get_lp_login() |
135 | + path = path.strip('/') |
136 | + path = _expand_user(path, url, _lp_login) |
137 | + result = _resolve_via_api(path, url) |
138 | + |
139 | + if 'launchpad' in debug.debug_flags: |
140 | + trace.mutter("resolve_lp_path(%r) == %r", url, result) |
141 | + |
142 | + _warned_login = False |
143 | + for url in result['urls']: |
144 | + scheme, netloc, path, query, fragment = urlsplit(url) |
145 | + if _requires_launchpad_login(scheme, netloc, path, query, |
146 | + fragment): |
147 | + # Only accept launchpad.net bzr+ssh URLs if we know |
148 | + # the user's Launchpad login: |
149 | + if _lp_login is not None: |
150 | + break |
151 | + if _lp_login is None: |
152 | + if not _warned_login: |
153 | + trace.warning( |
154 | + 'You have not informed bzr of your Launchpad ID, and you must do this to\n' |
155 | + 'write to Launchpad or access private data. See "bzr help launchpad-login".') |
156 | + _warned_login = True |
157 | + else: |
158 | + break |
159 | + else: |
160 | + raise InvalidURL(path=url, extra='no supported schemes') |
161 | + return url |
162 | |
163 | |
164 | class LaunchpadDirectory: |
165 | |
166 | def look_up(self, name, url, purpose=None): |
167 | """See DirectoryService.look_up""" |
168 | - return self._resolve(url) |
169 | - |
170 | - def _resolve_locally(self, path, url, _api_resolver): |
171 | - # This is the best I could work out. If an lp: url |
172 | - # includes ~user, then it is specially validated. Otherwise, it is just |
173 | - # sent to +branch/$path. |
174 | - _, netloc, _, _, _ = urlsplit(url) |
175 | - if netloc == '': |
176 | - netloc = DEFAULT_INSTANCE |
177 | - base_url = LAUNCHPAD_DOMAINS[netloc] |
178 | - base = 'bzr+ssh://bazaar.{}/'.format(base_url) |
179 | - maybe_invalid = False |
180 | - if path.startswith('~'): |
181 | - # A ~user style path, validate it a bit. |
182 | - # If a path looks fishy, fall back to asking the API to |
183 | - # resolve it for us. |
184 | - parts = path.split('/') |
185 | - if (len(parts) < 3 |
186 | - or (parts[1] in ('ubuntu', 'debian') and len(parts) < 5)): |
187 | - # This special case requires 5-parts to be valid. |
188 | - maybe_invalid = True |
189 | - else: |
190 | - base += '+branch/' |
191 | - if maybe_invalid: |
192 | - return _api_resolver(path, url) |
193 | - return {'urls': [base + path]} |
194 | - |
195 | - def _resolve(self, url, _api_resolver=_resolve_via_api, _lp_login=None): |
196 | - """Resolve the base URL for this transport.""" |
197 | - url, path = _update_url_scheme(url) |
198 | - if _lp_login is None: |
199 | - _lp_login = get_lp_login() |
200 | - path = path.strip('/') |
201 | - path = _expand_user(path, url, _lp_login) |
202 | - if _lp_login is not None: |
203 | - result = self._resolve_locally(path, url, _api_resolver) |
204 | - if 'launchpad' in debug.debug_flags: |
205 | - local_res = result |
206 | - result = _api_resolver(path, url) |
207 | - trace.note(gettext( |
208 | - 'resolution for {0}\n local: {1}\n remote: {2}').format( |
209 | - url, local_res['urls'], result['urls'])) |
210 | - else: |
211 | - result = _api_resolver(path, url) |
212 | - |
213 | - if 'launchpad' in debug.debug_flags: |
214 | - trace.mutter("resolve_lp_path(%r) == %r", url, result) |
215 | - |
216 | - _warned_login = False |
217 | - for url in result['urls']: |
218 | - scheme, netloc, path, query, fragment = urlsplit(url) |
219 | - if _requires_launchpad_login(scheme, netloc, path, query, |
220 | - fragment): |
221 | - # Only accept launchpad.net bzr+ssh URLs if we know |
222 | - # the user's Launchpad login: |
223 | - if _lp_login is not None: |
224 | - break |
225 | - if _lp_login is None: |
226 | - if not _warned_login: |
227 | - trace.warning( |
228 | - 'You have not informed bzr of your Launchpad ID, and you must do this to\n' |
229 | - 'write to Launchpad or access private data. See "bzr help launchpad-login".') |
230 | - _warned_login = True |
231 | - else: |
232 | - # Use the URL if we can create a transport for it. |
233 | - try: |
234 | - transport.get_transport(url) |
235 | - except (errors.PathError, errors.TransportError): |
236 | - pass |
237 | - else: |
238 | - break |
239 | - else: |
240 | - raise InvalidURL(path=url, extra='no supported schemes') |
241 | - return url |
242 | - |
243 | + return _resolve(url) |
244 | |
245 | def get_test_permutations(): |
246 | # Since this transport doesn't do anything once opened, it's not subjected |
247 | |
248 | === modified file 'breezy/plugins/launchpad/test_lp_directory.py' |
249 | --- breezy/plugins/launchpad/test_lp_directory.py 2023-01-31 01:05:40 +0000 |
250 | +++ breezy/plugins/launchpad/test_lp_directory.py 2023-07-17 17:35:02 +0000 |
251 | @@ -29,7 +29,7 @@ |
252 | http_server, ssl_certs) |
253 | from . import _register_directory |
254 | from .account import get_lp_login, set_lp_login |
255 | -from .lp_directory import LaunchpadDirectory |
256 | +from .lp_directory import LaunchpadDirectory, _resolve |
257 | |
258 | |
259 | class FakeResolveFactory: |
260 | @@ -44,257 +44,6 @@ |
261 | return self._result |
262 | |
263 | |
264 | -class LocalDirectoryURLTests(TestCaseInTempDir): |
265 | - """Tests for branch urls that we try to pass through local resolution.""" |
266 | - |
267 | - def assertResolve(self, expected, url): |
268 | - path = url[url.index(':') + 1:].lstrip('/') |
269 | - factory = FakeResolveFactory(self, path, |
270 | - dict(urls=['bzr+ssh://fake-resolved'])) |
271 | - directory = LaunchpadDirectory() |
272 | - self.assertEqual(expected, |
273 | - directory._resolve(url, factory, _lp_login='user')) |
274 | - |
275 | - def test_short_form(self): |
276 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/apt', |
277 | - 'lp:apt') |
278 | - |
279 | - def test_short_form_bzr(self): |
280 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/apt', |
281 | - 'lp+bzr:apt') |
282 | - |
283 | - def test_two_part_form(self): |
284 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/apt/2.2', |
285 | - 'lp:apt/2.2') |
286 | - |
287 | - def test_two_part_plus_subdir(self): |
288 | - # We allow you to pass more than just what resolves. That way you can |
289 | - # do things like "brz log lp:apt/2.2/BUGS" |
290 | - # Though the virtual FS implementation currently aborts when given a |
291 | - # URL like this, rather than letting you recurse upwards to find the |
292 | - # real branch at lp:apt/2.2 |
293 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/apt/2.2/BUGS', |
294 | - 'lp:apt/2.2/BUGS') |
295 | - |
296 | - def test_user_expansion(self): |
297 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/~user/apt/foo', |
298 | - 'lp:~/apt/foo') |
299 | - |
300 | - def test_ubuntu(self): |
301 | - # Confirmed against xmlrpc. If you don't have a ~user, xmlrpc doesn't |
302 | - # care that you are asking for 'ubuntu' |
303 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/ubuntu', |
304 | - 'lp:ubuntu') |
305 | - |
306 | - def test_user_two_part(self): |
307 | - # We fall back to the ResolveFactory. The real Launchpad one will raise |
308 | - # InvalidURL for this case. |
309 | - self.assertResolve('bzr+ssh://fake-resolved', 'lp:~jameinel/apt') |
310 | - |
311 | - def test_user_three_part(self): |
312 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/~jameinel/apt/foo', |
313 | - 'lp:~jameinel/apt/foo') |
314 | - |
315 | - def test_user_three_part_plus_filename(self): |
316 | - self.assertResolve( |
317 | - 'bzr+ssh://bazaar.launchpad.net/~jameinel/apt/foo/fname', |
318 | - 'lp:~jameinel/apt/foo/fname') |
319 | - |
320 | - def test_user_ubuntu_two_part(self): |
321 | - self.assertResolve('bzr+ssh://fake-resolved', 'lp:~jameinel/ubuntu') |
322 | - self.assertResolve('bzr+ssh://fake-resolved', 'lp:~jameinel/debian') |
323 | - |
324 | - def test_user_ubuntu_three_part(self): |
325 | - self.assertResolve('bzr+ssh://fake-resolved', |
326 | - 'lp:~jameinel/ubuntu/natty') |
327 | - self.assertResolve('bzr+ssh://fake-resolved', |
328 | - 'lp:~jameinel/debian/sid') |
329 | - |
330 | - def test_user_ubuntu_four_part(self): |
331 | - self.assertResolve('bzr+ssh://fake-resolved', |
332 | - 'lp:~jameinel/ubuntu/natty/project') |
333 | - self.assertResolve('bzr+ssh://fake-resolved', |
334 | - 'lp:~jameinel/debian/sid/project') |
335 | - |
336 | - def test_user_ubuntu_five_part(self): |
337 | - self.assertResolve( |
338 | - 'bzr+ssh://bazaar.launchpad.net/~jameinel/ubuntu/natty/apt/branch', |
339 | - 'lp:~jameinel/ubuntu/natty/apt/branch') |
340 | - self.assertResolve( |
341 | - 'bzr+ssh://bazaar.launchpad.net/~jameinel/debian/sid/apt/branch', |
342 | - 'lp:~jameinel/debian/sid/apt/branch') |
343 | - |
344 | - def test_user_ubuntu_five_part_plus_subdir(self): |
345 | - self.assertResolve( |
346 | - 'bzr+ssh://bazaar.launchpad.net/~jameinel/ubuntu/natty/apt/branch/f', |
347 | - 'lp:~jameinel/ubuntu/natty/apt/branch/f') |
348 | - self.assertResolve( |
349 | - 'bzr+ssh://bazaar.launchpad.net/~jameinel/debian/sid/apt/branch/f', |
350 | - 'lp:~jameinel/debian/sid/apt/branch/f') |
351 | - |
352 | - def test_handles_special_lp(self): |
353 | - self.assertResolve( |
354 | - 'bzr+ssh://bazaar.launchpad.net/+branch/apt', 'lp:apt') |
355 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/apt', |
356 | - 'lp:///apt') |
357 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/apt', |
358 | - 'lp://production/apt') |
359 | - self.assertResolve('bzr+ssh://bazaar.launchpad.test/+branch/apt', |
360 | - 'lp://test/apt') |
361 | - self.assertResolve('bzr+ssh://bazaar.staging.launchpad.net/+branch/apt', |
362 | - 'lp://staging/apt') |
363 | - self.assertResolve('bzr+ssh://bazaar.qastaging.launchpad.net/+branch/apt', |
364 | - 'lp://qastaging/apt') |
365 | - self.assertResolve('bzr+ssh://bazaar.demo.launchpad.net/+branch/apt', |
366 | - 'lp://demo/apt') |
367 | - |
368 | - def test_debug_launchpad_uses_resolver(self): |
369 | - self.assertResolve('bzr+ssh://bazaar.launchpad.net/+branch/bzr', |
370 | - 'lp:bzr') |
371 | - debug.debug_flags.add('launchpad') |
372 | - self.addCleanup(debug.debug_flags.discard, 'launchpad') |
373 | - self.assertResolve('bzr+ssh://fake-resolved', 'lp:bzr') |
374 | - |
375 | - |
376 | -class DirectoryUrlTests(TestCaseInTempDir): |
377 | - """Tests for branch urls through Launchpad.net directory""" |
378 | - |
379 | - def test_short_form(self): |
380 | - """A launchpad url should map to a http url""" |
381 | - factory = FakeResolveFactory( |
382 | - self, 'apt', dict(urls=[ |
383 | - 'http://bazaar.launchpad.net/~apt/apt/devel'])) |
384 | - directory = LaunchpadDirectory() |
385 | - self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel', |
386 | - directory._resolve('lp:apt', factory)) |
387 | - |
388 | - def test_qastaging(self): |
389 | - """A launchpad url should map to a http url""" |
390 | - factory = FakeResolveFactory( |
391 | - self, 'apt', dict(urls=[ |
392 | - 'http://bazaar.qastaging.launchpad.net/~apt/apt/devel'])) |
393 | - url = 'lp://qastaging/apt' |
394 | - directory = LaunchpadDirectory() |
395 | - self.assertEqual('http://bazaar.qastaging.launchpad.net/~apt/apt/devel', |
396 | - directory._resolve(url, factory)) |
397 | - |
398 | - def test_staging(self): |
399 | - """A launchpad url should map to a http url""" |
400 | - factory = FakeResolveFactory( |
401 | - self, 'apt', dict(urls=[ |
402 | - 'http://bazaar.staging.launchpad.net/~apt/apt/devel'])) |
403 | - url = 'lp://staging/apt' |
404 | - directory = LaunchpadDirectory() |
405 | - self.assertEqual('http://bazaar.staging.launchpad.net/~apt/apt/devel', |
406 | - directory._resolve(url, factory)) |
407 | - |
408 | - def test_url_from_directory(self): |
409 | - """A launchpad url should map to a http url""" |
410 | - factory = FakeResolveFactory( |
411 | - self, 'apt', dict(urls=[ |
412 | - 'http://bazaar.launchpad.net/~apt/apt/devel'])) |
413 | - directory = LaunchpadDirectory() |
414 | - self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel', |
415 | - directory._resolve('lp:///apt', factory)) |
416 | - |
417 | - def test_directory_skip_bad_schemes(self): |
418 | - factory = FakeResolveFactory( |
419 | - self, 'apt', dict(urls=[ |
420 | - 'bad-scheme://bazaar.launchpad.net/~apt/apt/devel', |
421 | - 'http://bazaar.launchpad.net/~apt/apt/devel', |
422 | - 'http://another/location'])) |
423 | - directory = LaunchpadDirectory() |
424 | - self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel', |
425 | - directory._resolve('lp:///apt', factory)) |
426 | - |
427 | - def test_directory_no_matching_schemes(self): |
428 | - # If the XMLRPC call does not return any protocols we support, |
429 | - # invalidURL is raised. |
430 | - factory = FakeResolveFactory( |
431 | - self, 'apt', dict(urls=[ |
432 | - 'bad-scheme://bazaar.launchpad.net/~apt/apt/devel'])) |
433 | - directory = LaunchpadDirectory() |
434 | - self.assertRaises(urlutils.InvalidURL, |
435 | - directory._resolve, 'lp:///apt', factory) |
436 | - |
437 | - def test_skip_bzr_ssh_launchpad_net_when_anonymous(self): |
438 | - # Test that bzr+ssh://bazaar.launchpad.net gets skipped if |
439 | - # Bazaar does not know the user's Launchpad ID: |
440 | - self.assertEqual(None, get_lp_login()) |
441 | - factory = FakeResolveFactory( |
442 | - self, 'apt', dict(urls=[ |
443 | - 'bzr+ssh://bazaar.launchpad.net/~apt/apt/devel', |
444 | - 'http://bazaar.launchpad.net/~apt/apt/devel'])) |
445 | - directory = LaunchpadDirectory() |
446 | - self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel', |
447 | - directory._resolve('lp:///apt', factory)) |
448 | - |
449 | - def test_skip_sftp_launchpad_net_when_anonymous(self): |
450 | - # Test that sftp://bazaar.launchpad.net gets skipped if |
451 | - # Bazaar does not know the user's Launchpad ID: |
452 | - self.assertEqual(None, get_lp_login()) |
453 | - factory = FakeResolveFactory( |
454 | - self, 'apt', dict(urls=[ |
455 | - 'sftp://bazaar.launchpad.net/~apt/apt/devel', |
456 | - 'http://bazaar.launchpad.net/~apt/apt/devel'])) |
457 | - directory = LaunchpadDirectory() |
458 | - self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel', |
459 | - directory._resolve('lp:///apt', factory)) |
460 | - |
461 | - def test_with_login_avoid_resolve_factory(self): |
462 | - # Test that bzr+ssh URLs get rewritten to include the user's |
463 | - # Launchpad ID (assuming we know the Launchpad ID). |
464 | - factory = FakeResolveFactory( |
465 | - self, 'apt', dict(urls=[ |
466 | - 'bzr+ssh://my-super-custom/special/devel', |
467 | - 'http://bazaar.launchpad.net/~apt/apt/devel'])) |
468 | - directory = LaunchpadDirectory() |
469 | - self.assertEqual( |
470 | - 'bzr+ssh://bazaar.launchpad.net/+branch/apt', |
471 | - directory._resolve('lp:///apt', factory, _lp_login='username')) |
472 | - |
473 | - def test_no_rewrite_of_other_bzr_ssh(self): |
474 | - # Test that we don't rewrite bzr+ssh URLs for other |
475 | - self.assertEqual(None, get_lp_login()) |
476 | - factory = FakeResolveFactory( |
477 | - self, 'apt', dict(urls=[ |
478 | - 'bzr+ssh://example.com/~apt/apt/devel', |
479 | - 'http://bazaar.launchpad.net/~apt/apt/devel'])) |
480 | - directory = LaunchpadDirectory() |
481 | - self.assertEqual('bzr+ssh://example.com/~apt/apt/devel', |
482 | - directory._resolve('lp:///apt', factory)) |
483 | - |
484 | - # TODO: check we get an error if the url is unreasonable |
485 | - def test_error_for_bad_url(self): |
486 | - directory = LaunchpadDirectory() |
487 | - factory = FakeResolveFactory(self, '', {'urls': []}) |
488 | - self.assertRaises(urlutils.InvalidURL, |
489 | - directory._resolve, 'lp://ratotehunoahu', factory) |
490 | - |
491 | - def test_resolve_tilde_to_user(self): |
492 | - factory = FakeResolveFactory( |
493 | - self, '~username/apt/test', dict(urls=[ |
494 | - 'bzr+ssh://bazaar.launchpad.net/~username/apt/test'])) |
495 | - directory = LaunchpadDirectory() |
496 | - self.assertEqual( |
497 | - 'bzr+ssh://bazaar.launchpad.net/~username/apt/test', |
498 | - directory._resolve('lp:~/apt/test', factory, _lp_login='username')) |
499 | - # Should also happen when the login is just set by config |
500 | - set_lp_login('username') |
501 | - self.assertEqual( |
502 | - 'bzr+ssh://bazaar.launchpad.net/~username/apt/test', |
503 | - directory._resolve('lp:~/apt/test', factory)) |
504 | - |
505 | - def test_tilde_fails_no_login(self): |
506 | - factory = FakeResolveFactory( |
507 | - self, '~username/apt/test', dict(urls=[ |
508 | - 'bzr+ssh://bazaar.launchpad.net/~username/apt/test'])) |
509 | - self.assertIs(None, get_lp_login()) |
510 | - directory = LaunchpadDirectory() |
511 | - self.assertRaises(urlutils.InvalidURL, |
512 | - directory._resolve, 'lp:~/apt/test', factory) |
513 | - |
514 | - |
515 | class DirectoryOpenBranchTests(TestCaseWithMemoryTransport): |
516 | |
517 | def test_directory_open_branch(self): |
518 | |
519 | === modified file 'lib-rio/Cargo.toml' |
520 | --- lib-rio/Cargo.toml 2023-02-14 02:35:03 +0000 |
521 | +++ lib-rio/Cargo.toml 2023-07-17 17:35:02 +0000 |
522 | @@ -1,6 +1,6 @@ |
523 | [package] |
524 | name = "rio-py" |
525 | -version = "3.3.3" |
526 | +version = "3.3.4" |
527 | edition = "2018" |
528 | |
529 | [lib] |
The attempt to merge lp:~jelmer/brz/lp-check-vcs into lp:brz/3.3 failed. Command exited with 1.
Below is the output from the failed tests.
... OUTPUT TRIMMED ...
breezy. plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ from_subdir( SFTPTransport, SFTPHomeDirServ er) OK 41ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ from_subdir( SFTPTransport, SFTPSiblingAbso luteServer) OK 41ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ noauto( LocalTransport, LocalURLServer) OK 69ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ noauto( SFTPTransport, SFTPAbsoluteSer ver) OK 94ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ noauto( SFTPTransport, SFTPHomeDirServ er) OK 88ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ noauto( SFTPTransport, SFTPSiblingAbso luteServer) OK 85ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revid_path_ in_dir( LocalTransport, LocalURLServer) OK 65ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revid_path_ in_dir( SFTPTransport, SFTPAbsoluteSer ver) OK 76ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revid_path_ in_dir( SFTPTransport, SFTPHomeDirServ er) OK 71ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revid_path_ in_dir( SFTPTransport, SFTPSiblingAbso luteServer) OK 73ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revision( LocalTransport, LocalURLServer) OK 55ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revision( SFTPTransport, SFTPAbsoluteSer ver) OK 75ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revision( SFTPTransport, SFTPHomeDirServ er) OK 54ms plugins. upload. tests.test_ upload. TestIncremental Upload. test_upload_ revision( SFTPTransport, SFTPSiblingAbso luteServer) OK 57ms plugins. upload. tests.test_ upload. TestUploadFromR emoteBranch. test_no_ upload_ to_remote_ working_ tree(LocalTrans port,LocalURLSe rver) OK 67ms plugins. upload. tests.test_ upload. TestUploadFromR emoteBranch. test_no_ upload_ to_remote_ working_ tree(SFTPTransp ort,SFTPAbsolut eServer) OK 93ms plugins. upload. tests.test_ upload. TestUploadFromR emoteBranch. test_no_ upload_ to_remote_ working_ tree(SFTPTransp ort,SFTPHomeDir Server) N/A 2ms plugins. upload. tests.test_ upload. TestUploadFromR emoteBranch. test_no_ upload_ to_remote_ working_ tree(SFTPTransp ort,SFTPSibling AbsoluteServer) OK 98ms plugins. upload. tests.test_ upload. TestUploadFromR emoteBranch. test_upload_ without_ working_ tree(LocalTrans port,LocalURLSe rver) OK 70ms plugins. upload. tests.test_ upload. TestUploadFromR emoteBranch. test_upload_ without_ working_ tree(SFTPTransp ort,SFTPAbsolut eServer) OK 108ms plugins. upload. tests.test_ upload. TestUploadFromR emoteBranch. test_upload_ without_ working_ tree(SFTPTransp ort,SFTPHomeDir Server) N/A 2ms
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
breezy.
Escaping test isolation
breezy.
breezy.
breezy.
breezy.
Escaping test isola...