/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/launchpad/lp_api.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
 
26
26
import httplib2
27
 
import os
28
27
import re
29
28
try:
30
29
    from urllib.parse import (
244
243
        lp_branch = launchpad.branches.getByUrl(url=url)
245
244
        if lp_branch is None:
246
245
            raise errors.BzrError(gettext('%s is not registered on Launchpad') %
247
 
                                                                            url)
 
246
                                  url)
248
247
        return lp_branch
249
248
 
250
249
    def get_target(self):
254
253
            dev_focus = lp_branch.project.development_focus
255
254
            if dev_focus is None:
256
255
                raise errors.BzrError(gettext('%s has no development focus.') %
257
 
                                  lp_branch.bzr_identity)
 
256
                                      lp_branch.bzr_identity)
258
257
            target = dev_focus.branch
259
258
            if target is None:
260
259
                raise errors.BzrError(gettext(
261
 
                        'development focus %s has no branch.') % dev_focus)
 
260
                    'development focus %s has no branch.') % dev_focus)
262
261
        elif lp_branch.sourcepackage is not None:
263
262
            target = lp_branch.sourcepackage.getBranch(pocket="Release")
264
263
            if target is None:
267
266
                                      lp_branch.sourcepackage)
268
267
        else:
269
268
            raise errors.BzrError(gettext(
270
 
                        '%s has no associated product or source package.') %
271
 
                                  lp_branch.bzr_identity)
 
269
                '%s has no associated product or source package.') %
 
270
                lp_branch.bzr_identity)
272
271
        return LaunchpadBranch(target, target.bzr_identity)
273
272
 
274
273
    def update_lp(self):
282
281
                               self.lp.bzr_identity)
283
282
                    return
284
283
                graph = self.bzr.repository.get_graph()
285
 
                if not graph.is_ancestor(self.lp.last_scanned_id,
 
284
                if not graph.is_ancestor(osutils.safe_utf8(self.lp.last_scanned_id),
286
285
                                         self.bzr.last_revision()):
287
286
                    raise errors.DivergedBranches(self.bzr, self.push_bzr)
288
287
                trace.note(gettext('Pushing to %s') % self.lp.bzr_identity)