~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/lp_directory.py

  • Committer: Marius Kruger
  • Date: 2010-08-15 04:52:51 UTC
  • mfrom: (5376 +trunk)
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100815045251-izmea8nn05thhrok
merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        """Resolve the base URL for this transport."""
65
65
        service = LaunchpadService.for_url(url)
66
66
        result = urlsplit(url)
67
 
        resolve = _request_factory(result[2].strip('/'))
 
67
        if _lp_login is None:
 
68
            _lp_login = get_lp_login()
 
69
        path = result[2].strip('/')
 
70
        if path.startswith('~/'):
 
71
            if _lp_login is None:
 
72
                raise errors.InvalidURL(path=url,
 
73
                    extra='Cannot resolve "~" to your username.'
 
74
                          ' See "bzr help launchpad-login"')
 
75
            path = '~' + _lp_login + path[1:]
 
76
        resolve = _request_factory(path)
68
77
        try:
69
78
            result = resolve.submit(service)
70
79
        except xmlrpclib.Fault, fault:
74
83
        if 'launchpad' in debug.debug_flags:
75
84
            trace.mutter("resolve_lp_path(%r) == %r", url, result)
76
85
 
77
 
        if _lp_login is None:
78
 
            _lp_login = get_lp_login()
79
86
        _warned_login = False
80
87
        for url in result['urls']:
81
88
            scheme, netloc, path, query, fragment = urlsplit(url)