/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/hoster.py

  • Committer: Jelmer Vernooij
  • Date: 2020-06-23 01:02:30 UTC
  • mfrom: (7490.40.27 work)
  • mto: This revision was merged to the branch mainline in revision 7517.
  • Revision ID: jelmer@jelmer.uk-20200623010230-62nnywznmb76h6ut
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
                self._mp.source_git_repository.git_identity,
118
118
                ref=self._mp.source_git_path.encode('utf-8'))
119
119
 
 
120
    def get_source_revision(self):
 
121
        if self._mp.source_branch:
 
122
            last_scanned_id = self._mp.source_branch.last_scanned_id
 
123
            if last_scanned_id:
 
124
                return last_scanned_id.encode('utf-8')
 
125
            else:
 
126
                return None
 
127
        else:
 
128
            from breezy.git.mapping import default_mapping
 
129
            git_repo = self._mp.source_git_repository
 
130
            git_ref = git_repo.getRefByPath(path=self._mp.source_git_path)
 
131
            sha = git_ref.commit_sha1
 
132
            if sha is None:
 
133
                return None
 
134
            return default_mapping.revision_id_foreign_to_bzr(
 
135
                sha.encode('ascii'))
 
136
 
120
137
    def get_target_branch_url(self):
121
138
        if self._mp.target_branch:
122
139
            return self._mp.target_branch.bzr_identity
533
550
    def check_proposal(self):
534
551
        """Check that the submission is sensible."""
535
552
        if self.source_branch_lp.self_link == self.target_branch_lp.self_link:
536
 
            raise errors.BzrCommandError(
 
553
            raise errors.CommandError(
537
554
                'Source and target branches must be different.')
538
555
        for mp in self.source_branch_lp.landing_targets:
539
556
            if mp.queue_status in ('Merged', 'Rejected'):
666
683
    def check_proposal(self):
667
684
        """Check that the submission is sensible."""
668
685
        if self.source_branch_lp.self_link == self.target_branch_lp.self_link:
669
 
            raise errors.BzrCommandError(
 
686
            raise errors.CommandError(
670
687
                'Source and target branches must be different.')
671
688
        for mp in self.source_branch_lp.landing_targets:
672
689
            if mp.queue_status in ('Merged', 'Rejected'):