~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-11-23 16:54:50 UTC
  • mfrom: (5546.2.4 find-review)
  • Revision ID: pqm@pqm.ubuntu.com-20101123165450-bmll7p8fjng1d8xy
Add lp-find-proposal command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
import urlparse
19
18
import webbrowser
20
19
 
21
20
from bzrlib import (
27
26
    lp_api,
28
27
    lp_registration,
29
28
)
 
29
from bzrlib.plugins.launchpad.lp_api import canonical_url
30
30
 
31
31
from lazr.restfulclient import errors as restful_errors
32
32
 
217
217
        old_tree):
218
218
        if c and k == 'file':
219
219
            yield str(path)
220
 
 
221
 
 
222
 
def canonical_url(object):
223
 
    """Return the canonical URL for a branch."""
224
 
    scheme, netloc, path, params, query, fragment = urlparse.urlparse(
225
 
        str(object.self_link))
226
 
    path = '/'.join(path.split('/')[2:])
227
 
    netloc = netloc.replace('api.', 'code.')
228
 
    return urlparse.urlunparse((scheme, netloc, path, params, query,
229
 
                                fragment))