~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-02 01:44:26 UTC
  • mfrom: (6518 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120402014426-0o5qtysohyl006b2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1174
1174
    @needs_read_lock
1175
1175
    def verify_revision_signature(self, revision_id, gpg_strategy):
1176
1176
        """Verify the signature on a revision.
1177
 
        
 
1177
 
1178
1178
        :param revision_id: the revision to verify
1179
1179
        :gpg_strategy: the GPGStrategy object to used
1180
 
        
 
1180
 
1181
1181
        :return: gpg.SIGNATURE_VALID or a failed SIGNATURE_ value
1182
1182
        """
1183
1183
        if not self.has_signature_for_revision_id(revision_id):
1189
1189
 
1190
1190
        return gpg_strategy.verify(signature, plaintext)
1191
1191
 
 
1192
    @needs_read_lock
 
1193
    def verify_revision_signatures(self, revision_ids, gpg_strategy):
 
1194
        """Verify revision signatures for a number of revisions.
 
1195
 
 
1196
        :param revision_id: the revision to verify
 
1197
        :gpg_strategy: the GPGStrategy object to used
 
1198
        :return: Iterator over tuples with revision id, result and keys
 
1199
        """
 
1200
        for revid in revision_ids:
 
1201
            (result, key) = self.verify_revision_signature(revid, gpg_strategy)
 
1202
            yield revid, result, key
 
1203
 
1192
1204
    def has_signature_for_revision_id(self, revision_id):
1193
1205
        """Query for a revision signature for revision_id in the repository."""
1194
1206
        raise NotImplementedError(self.has_signature_for_revision_id)