/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: Aaron Bentley
  • Date: 2010-04-21 08:46:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5171.
  • Revision ID: aaron@aaronbentley.com-20100421084615-17f4vlaby2mi79ep
Fix canonical_url in a more precise way.

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 re
 
18
import urlparse
19
19
import webbrowser
20
20
 
21
21
from bzrlib import (
203
203
 
204
204
def canonical_url(object):
205
205
    """Return the canonical URL for a branch."""
206
 
    url = object.self_link.replace('https://api.', 'https://code.')
207
 
    return re.sub('\/(beta|[0-9].[0-9])\/', '/', url)
 
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))