/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-22 00:45:34 UTC
  • mfrom: (5162.2.2 fix-lp-url)
  • Revision ID: pqm@pqm.ubuntu.com-20100422004534-nuqgl0mux4xw19kj
Fix canonical_url for new URL forms.

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
18
19
import webbrowser
19
20
 
20
21
from bzrlib import (
202
203
 
203
204
def canonical_url(object):
204
205
    """Return the canonical URL for a branch."""
205
 
    url = object.self_link.replace('https://api.', 'https://code.')
206
 
    return url.replace('/beta/', '/')
 
206
    scheme, netloc, path, params, query, fragment = urlparse.urlparse(
 
207
        str(object.self_link))
 
208
    path = '/'.join(path.split('/')[2:])
 
209
    netloc = netloc.replace('api.', 'code.')
 
210
    return urlparse.urlunparse((scheme, netloc, path, params, query,
 
211
                                fragment))