Class ApprovalCopier


  • public class ApprovalCopier
    extends Object
    Copies approvals between patch sets.

    The result of a copy may either be stored, as when stamping approvals in the database at submit time, or refreshed on demand, as when reading approvals from the NoteDb.

    • Method Detail

      • copyInReviewDb

        public void copyInReviewDb​(ReviewDb db,
                                   ChangeNotes notes,
                                   CurrentUser user,
                                   PatchSet ps,
                                   org.eclipse.jgit.revwalk.RevWalk rw,
                                   org.eclipse.jgit.lib.Config repoConfig)
                            throws com.google.gwtorm.server.OrmException
        Apply approval copy settings from prior PatchSets to a new PatchSet.
        Parameters:
        db - review database.
        notes - change notes for user uploading PatchSet
        user - user uploading PatchSet
        ps - new PatchSet
        rw - open walk that can read the patch set commit; null to open the repo on demand.
        repoConfig - repo config used for change kind detection; null to read from repo on demand.
        Throws:
        com.google.gwtorm.server.OrmException
      • copyInReviewDb

        public void copyInReviewDb​(ReviewDb db,
                                   ChangeNotes notes,
                                   CurrentUser user,
                                   PatchSet ps,
                                   org.eclipse.jgit.revwalk.RevWalk rw,
                                   org.eclipse.jgit.lib.Config repoConfig,
                                   Iterable<PatchSetApproval> dontCopy)
                            throws com.google.gwtorm.server.OrmException
        Apply approval copy settings from prior PatchSets to a new PatchSet.
        Parameters:
        db - review database.
        notes - change notes for user uploading PatchSet
        user - user uploading PatchSet
        ps - new PatchSet
        rw - open walk that can read the patch set commit; null to open the repo on demand.
        repoConfig - repo config used for change kind detection; null to read from repo on demand.
        dontCopy - PatchSetApprovals indicating which (account, label) pairs should not be copied
        Throws:
        com.google.gwtorm.server.OrmException