def updatePreviewDiff(self, diff_content, source_revision_id,
                       target_revision_id, prerequisite_revision_id=None,
                       conflicts=None):
     """See `IBranchMergeProposal`."""
     return PreviewDiff.create(
         self, diff_content, source_revision_id, target_revision_id,
         prerequisite_revision_id, conflicts)
Exemplo n.º 2
0
 def updatePreviewDiff(self,
                       diff_content,
                       source_revision_id,
                       target_revision_id,
                       prerequisite_revision_id=None,
                       conflicts=None):
     """See `IBranchMergeProposal`."""
     return PreviewDiff.create(self, diff_content, source_revision_id,
                               target_revision_id, prerequisite_revision_id,
                               conflicts)
Exemplo n.º 3
0
 def makeProposalWithSubscriber(self, diff_text=None, initial_comment=None,
                                prerequisite=False, needs_review=True,
                                reviewer=None):
     registrant = self.factory.makePerson(
         name='bazqux', displayname='Baz Qux', email='*****@*****.**')
     product = self.factory.makeProduct(name='super-product')
     if prerequisite:
         prerequisite_branch = self.factory.makeProductBranch(product)
     else:
         prerequisite_branch = None
     if needs_review:
         initial_status = BranchMergeProposalStatus.NEEDS_REVIEW
     else:
         initial_status = BranchMergeProposalStatus.WORK_IN_PROGRESS
     bmp = self.factory.makeBranchMergeProposal(
         registrant=registrant, product=product, set_state=initial_status,
         prerequisite_branch=prerequisite_branch,
         initial_comment=initial_comment, reviewer=reviewer)
     if diff_text:
         PreviewDiff.create(
             bmp, diff_text, unicode(self.factory.getUniqueString('revid')),
             unicode(self.factory.getUniqueString('revid')), None, None)
         transaction.commit()
     subscriber = self.factory.makePerson(displayname='Baz Quxx',
         email='*****@*****.**')
     bmp.source_branch.subscribe(subscriber,
         BranchSubscriptionNotificationLevel.NOEMAIL, None,
         CodeReviewNotificationLevel.FULL, subscriber)
     bmp.source_branch.owner.name = 'bob'
     bmp.source_branch.name = 'fix-foo-for-bar'
     bmp.target_branch.owner.name = 'mary'
     bmp.target_branch.name = 'bar'
     bmp.commit_message = 'commit message'
     # Call the function that is normally called through the event system
     # to auto reload the fields updated by the db triggers.
     update_trigger_modified_fields(bmp.source_branch)
     update_trigger_modified_fields(bmp.target_branch)
     return bmp, subscriber
 def makeProposalWithSubscriber(self, diff_text=None, initial_comment=None,
                                prerequisite=False, needs_review=True,
                                reviewer=None):
     registrant = self.factory.makePerson(
         name='bazqux', displayname='Baz Qux', email='*****@*****.**')
     product = self.factory.makeProduct(name='super-product')
     if prerequisite:
         prerequisite_branch = self.factory.makeProductBranch(product)
     else:
         prerequisite_branch = None
     if needs_review:
         initial_status = BranchMergeProposalStatus.NEEDS_REVIEW
     else:
         initial_status = BranchMergeProposalStatus.WORK_IN_PROGRESS
     bmp = self.factory.makeBranchMergeProposal(
         registrant=registrant, product=product, set_state=initial_status,
         prerequisite_branch=prerequisite_branch,
         initial_comment=initial_comment, reviewer=reviewer)
     if diff_text:
         PreviewDiff.create(
             bmp, diff_text, unicode(self.factory.getUniqueString('revid')),
             unicode(self.factory.getUniqueString('revid')), None, None)
         transaction.commit()
     subscriber = self.factory.makePerson(displayname='Baz Quxx',
         email='*****@*****.**')
     bmp.source_branch.subscribe(subscriber,
         BranchSubscriptionNotificationLevel.NOEMAIL, None,
         CodeReviewNotificationLevel.FULL, subscriber)
     bmp.source_branch.owner.name = 'bob'
     bmp.source_branch.name = 'fix-foo-for-bar'
     bmp.target_branch.owner.name = 'mary'
     bmp.target_branch.name = 'bar'
     bmp.commit_message = 'commit message'
     # Call the function that is normally called through the event system
     # to auto reload the fields updated by the db triggers.
     update_trigger_modified_fields(bmp.source_branch)
     update_trigger_modified_fields(bmp.target_branch)
     return bmp, subscriber