~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-15 21:35:53 UTC
  • mfrom: (6507.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20120315213553-pj1g3cjj19nstvns
(vila) Merge 2.5 branch including fix for bug #956027 (Vincent
 Ladeuil)

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)
1224
1236
            return
1225
1237
        try:
1226
1238
            if branch is None:
1227
 
                conf = config.GlobalConfig()
 
1239
                conf = config.GlobalStack()
1228
1240
            else:
1229
 
                conf = branch.get_config()
1230
 
            if conf.suppress_warning('format_deprecation'):
 
1241
                conf = branch.get_config_stack()
 
1242
            if 'format_deprecation' in conf.get('suppress_warnings'):
1231
1243
                return
1232
1244
            warning("Format %s for %s is deprecated -"
1233
1245
                    " please use 'bzr upgrade' to get better performance"