~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-11 08:45:19 UTC
  • mfrom: (4597.9.22 reports-conflict-resolved)
  • Revision ID: pqm@pqm.ubuntu.com-20101111084519-bmk1zmblp7kex41a
(vila) More feedback about the conflicts just resolved and the remaining
 ones. (Vincent Ladeuil)

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 (
26
27
    lp_api,
27
28
    lp_registration,
28
29
)
29
 
from bzrlib.plugins.launchpad.lp_api import canonical_url
30
30
 
31
31
from lazr.restfulclient import errors as restful_errors
32
32
 
74
74
        if staging:
75
75
            lp_instance = 'staging'
76
76
        else:
77
 
            lp_instance = 'production'
 
77
            lp_instance = 'edge'
78
78
        service = lp_registration.LaunchpadService(lp_instance=lp_instance)
79
79
        self.launchpad = lp_api.login(service)
80
80
        self.source_branch = lp_api.LaunchpadBranch.from_bzr(
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))