← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/bug-bmp-activity into lp:launchpad

 

Review: Approve code



Diff comments:

> === modified file 'lib/lp/bugs/adapters/bugchange.py'
> --- lib/lp/bugs/adapters/bugchange.py	2015-07-08 16:05:11 +0000
> +++ lib/lp/bugs/adapters/bugchange.py	2016-06-25 09:48:33 +0000
> @@ -395,6 +401,56 @@
>          return {'text': '** Branch unlinked: %s' % self.branch.bzr_identity}
>  
>  
> +class MergeProposalLinkedToBug(BugChangeBase):
> +    """A merge proposal got linked to the bug."""
> +
> +    def __init__(self, when, person, merge_proposal, bug):
> +        super(MergeProposalLinkedToBug, self).__init__(when, person)
> +        self.merge_proposal = merge_proposal
> +        self.bug = bug
> +
> +    def getBugActivity(self):
> +        """See `IBugChange`."""
> +        if self.merge_proposal.private:
> +            return None
> +        return dict(
> +            whatchanged=MERGE_PROPOSAL_LINKED,
> +            newvalue=canonical_url(self.merge_proposal))
> +
> +    def getBugNotification(self):
> +        """See `IBugChange`."""
> +        if self.merge_proposal.private or self.bug.is_complete:
> +            return None
> +        return {
> +            'text': '** Merge proposal linked: %s' % (
> +                canonical_url(self.merge_proposal))}

This line could be quite long. Perhaps break the URL onto a new line, like BugConvertedToQuestion?

> +
> +
> +class MergeProposalUnlinkedFromBug(BugChangeBase):
> +    """A merge proposal got unlinked from the bug."""
> +
> +    def __init__(self, when, person, merge_proposal, bug):
> +        super(MergeProposalUnlinkedFromBug, self).__init__(when, person)
> +        self.merge_proposal = merge_proposal
> +        self.bug = bug
> +
> +    def getBugActivity(self):
> +        """See `IBugChange`."""
> +        if self.merge_proposal.private:
> +            return None
> +        return dict(
> +            whatchanged=MERGE_PROPOSAL_UNLINKED,
> +            oldvalue=canonical_url(self.merge_proposal))
> +
> +    def getBugNotification(self):
> +        """See `IBugChange`."""
> +        if self.merge_proposal.private or self.bug.is_complete:
> +            return None
> +        return {
> +            'text': '** Merge proposal unlinked: %s' % (
> +                canonical_url(self.merge_proposal))}
> +
> +
>  class BugDescriptionChange(AttributeChange):
>      """Describes a change to a bug's description."""
>  


-- 
https://code.launchpad.net/~cjwatson/launchpad/bug-bmp-activity/+merge/298367
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References