[MERGE] Don't use sftp:// URLs as lp:/// translations when there's no Launchpad login.
Ian Clatworthy
ian.clatworthy at internode.on.net
Wed Dec 5 01:12:31 GMT 2007
Jonathan Lange wrote:
> Another simple patch.
bb:tweak
> + def _requires_launchpad_login(self, url):
> + """Does the URL require a Launchpad login in order to be reached?"""
> + scheme, netloc, path, query, fragment = urlsplit(url)
> + return (scheme in ('bzr+ssh', 'sftp')
> + and (netloc.endswith('launchpad.net')
> + or netloc.endswith('launchpad.dev')))
> +
> def _resolve(self, abspath,
> _request_factory=ResolveLaunchpadPathRequest,
> _lp_login=None):
> @@ -83,8 +90,7 @@
> _lp_login = get_lp_login()
> for url in result['urls']:
> scheme, netloc, path, query, fragment = urlsplit(url)
> - if scheme == 'bzr+ssh' and (netloc.endswith('launchpad.net') or
> - netloc.endswith('launchpad.dev')):
> + if self._requires_launchpad_login(url):
You always split the url twice now. One option is to pass the URL pieces
into _require_launchpad_login(). Another is to only split a second time
inside the if branch - the pieces don't seem to be used in the else clause.
Ian C.
More information about the bazaar
mailing list