/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 breezy/plugins/propose/launchpad.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-10-27 18:21:19 UTC
  • mfrom: (7408.2.1 git-branch-escaping)
  • Revision ID: breezy.the.bot@gmail.com-20191027182119-ah6bshqaabi0ddva
Use standard functions for creating Git URLs.

Merged from https://code.launchpad.net/~jelmer/brz/git-branch-escaping/+merge/374756

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    hooks,
40
40
    urlutils,
41
41
    )
42
 
from ...git.refs import ref_to_branch_name
 
42
from ...git.urls import git_url_to_bzr_url
43
43
from ...lazy_import import lazy_import
44
44
lazy_import(globals(), """
45
45
from breezy.plugins.launchpad import (
114
114
        if self._mp.source_branch:
115
115
            return self._mp.source_branch.bzr_identity
116
116
        else:
117
 
            branch_name = ref_to_branch_name(
118
 
                self._mp.source_git_path.encode('utf-8'))
119
 
            return urlutils.join_segment_parameters(
 
117
            return git_url_to_bzr_url(
120
118
                self._mp.source_git_repository.git_identity,
121
 
                {"branch": str(branch_name)})
 
119
                ref=self._mp.source_git_path.encode('utf-8'))
122
120
 
123
121
    def get_target_branch_url(self):
124
122
        if self._mp.target_branch:
125
123
            return self._mp.target_branch.bzr_identity
126
124
        else:
127
 
            branch_name = ref_to_branch_name(
128
 
                self._mp.target_git_path.encode('utf-8'))
129
 
            return urlutils.join_segment_parameters(
 
125
            return git_url_to_bzr_url(
130
126
                self._mp.target_git_repository.git_identity,
131
 
                {"branch": str(branch_name)})
 
127
                ref=self._mp.target_git_path.encode('utf-8'))
132
128
 
133
129
    @property
134
130
    def url(self):