[MERGE][1.0] Don't use sftp:// URLs as lp:/// translations when there's no Launchpad login.

Jonathan Lange jml at mumak.net
Wed Dec 5 01:39:17 GMT 2007


On Dec 5, 2007 12:12 PM, Ian Clatworthy <ian.clatworthy at internode.on.net> wrote:
> 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.
>

Good point. I've taken the first option.

New bundle attached for landing.

jml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-sftp-wo-lp-login-2.patch
Type: text/x-diff
Size: 7155 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071205/eb8faa83/attachment.bin 


More information about the bazaar mailing list