~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-10-17 21:57:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1462.
  • Revision ID: robertc@robertcollins.net-20051017215732-08f487800e726748
Allow creation of testaments from uncommitted data, and use that to get signatures before committing revisions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1258
1258
            raise InvalidRevisionNumber(revno)
1259
1259
        
1260
1260
    def sign_revision(self, revision_id, gpg_strategy):
 
1261
        plaintext = Testament.from_revision(self, revision_id).as_short_text()
 
1262
        self.store_revision_signature(gpg_strategy, plaintext, revision_id)
 
1263
 
 
1264
    def store_revision_signature(self, gpg_strategy, plaintext, revision_id):
1261
1265
        self.lock_write()
1262
1266
        try:
1263
 
            plaintext = Testament.from_revision(self, revision_id).as_short_text()
1264
1267
            self.revision_store.add(StringIO(gpg_strategy.sign(plaintext)), 
1265
1268
                                    revision_id, "sig")
1266
1269
        finally: