/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: Jelmer Vernooij
  • Date: 2019-01-02 21:59:47 UTC
  • mfrom: (0.431.64 trunk)
  • mto: This revision was merged to the branch mainline in revision 7239.
  • Revision ID: jelmer@jelmer.uk-20190102215947-bv6tjqf5rg71id76
Merge lp:brz-propose.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    hooks,
39
39
    urlutils,
40
40
    )
 
41
from ...git.refs import ref_to_branch_name
41
42
from ...lazy_import import lazy_import
42
43
lazy_import(globals(), """
43
44
from breezy.plugins.launchpad import (
103
104
    def __init__(self, mp):
104
105
        self._mp = mp
105
106
 
 
107
    def get_source_branch_url(self):
 
108
        if self._mp.source_branch:
 
109
            return self._mp.source_branch.bzr_identity
 
110
        else:
 
111
            return urlutils.join_segment_parameters(
 
112
                self._mp.source_git_repository.git_identity,
 
113
                {"branch": ref_to_branch_name(self._mp.source_git_path.encode('utf-8'))})
 
114
 
 
115
    def get_target_branch_url(self):
 
116
        if self._mp.target_branch:
 
117
            return self._mp.target_branch.bzr_identity
 
118
        else:
 
119
            return urlutils.join_segment_parameters(
 
120
                self._mp.target_git_repository.git_identity,
 
121
                {"branch": ref_to_branch_name(self._mp.target_git_path.encode('utf-8'))})
 
122
 
106
123
    @property
107
124
    def url(self):
108
125
        return lp_api.canonical_url(self._mp)
179
196
        if dir_to is None:
180
197
            try:
181
198
                br_to = local_branch.create_clone_on_transport(
182
 
                    to_transport, revision_id=revision_id, name=name,
183
 
                    stacked_on=main_branch.user_url)
 
199
                    to_transport, revision_id=revision_id, name=name)
184
200
            except errors.NoRoundtrippingSupport:
185
201
                br_to = local_branch.create_clone_on_transport(
186
202
                    to_transport, revision_id=revision_id, name=name,
187
 
                    stacked_on=main_branch.user_url, lossy=True)
 
203
                    lossy=True)
188
204
        else:
189
205
            try:
190
206
                dir_to = dir_to.push_branch(local_branch, revision_id, overwrite=overwrite, name=name)