~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robert Collins
  • Date: 2005-10-17 23:35:18 UTC
  • mfrom: (1442.1.65)
  • Revision ID: robertc@robertcollins.net-20051017233518-6746654be564edde
Merge in more GPG work, and more Branch-api-shrinkage.

* Branch.remove has been moved to WorkingTree, which has also gained
  lock_read, lock_write and unlock methods for convenience. (Robert
  Collins)

* Two decorators, needs_read_lock and needs_write_lock have been added
  to the branch module. Use these to cause a function to run in a
  read or write lock respectively. (Robert Collins)

* Branch.open_containing now returns a tuple (Branch, relative-path),
  which allows direct access to the common case of 'get me this file
  from its branch'. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
                           )
80
80
import bzrlib.gpg as gpg
81
81
from bzrlib.revision import Revision
 
82
from bzrlib.testament import Testament
82
83
from bzrlib.trace import mutter, note, warning
83
84
from bzrlib.xml5 import serializer_v5
84
85
from bzrlib.inventory import Inventory, ROOT_ID
321
322
        rev_tmp = StringIO()
322
323
        serializer_v5.write_revision(self.rev, rev_tmp)
323
324
        rev_tmp.seek(0)
 
325
        if self.config.signature_needed():
 
326
            plaintext = Testament(self.rev, self.new_inv).as_short_text()
 
327
            self.branch.store_revision_signature(gpg.GPGStrategy(self.config),
 
328
                                                 plaintext, self.rev_id)
324
329
        self.branch.revision_store.add(rev_tmp, self.rev_id)
325
 
        if self.config.signature_needed():
326
 
            self.branch.sign_revision(self.rev_id, gpg.GPGStrategy(self.config))
327
330
        mutter('new revision_id is {%s}', self.rev_id)
328
331
 
329
332
    def _remove_deleted(self):