~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_branch.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:29:53 UTC
  • mfrom: (1608 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060310062953-bc1c7ade75c89a7a
[merge] bzr.dev; pycurl not updated for readv yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
        branch.repository.sign_revision('A', strategy)
243
243
        self.assertEqual(Testament.from_revision(branch.repository, 
244
244
                         'A').as_short_text(),
245
 
                         branch.repository.revision_store.get('A', 
246
 
                         'sig').read())
 
245
                         branch.repository.get_signature_text('A'))
247
246
 
248
247
    def test_store_signature(self):
249
 
        branch = self.get_branch()
 
248
        wt = self.make_branch_and_tree('.')
 
249
        branch = wt.branch
250
250
        branch.repository.store_revision_signature(
251
251
            bzrlib.gpg.LoopbackGPGStrategy(None), 'FOO', 'A')
 
252
        self.assertRaises(errors.NoSuchRevision,
 
253
                          branch.repository.has_signature_for_revision_id,
 
254
                          'A')
 
255
        wt.commit("base", allow_pointless=True, rev_id='A')
252
256
        self.assertEqual('FOO', 
253
 
                         branch.repository.revision_store.get('A', 
254
 
                         'sig').read())
 
257
                         branch.repository.get_signature_text('A'))
255
258
 
256
259
    def test_branch_keeps_signatures(self):
257
260
        wt = self.make_branch_and_tree('source')
262
265
        # wt.clone should work to disks.
263
266
        self.build_tree(['target/'])
264
267
        d2 = wt.bzrdir.clone('target')
265
 
        self.assertEqual(wt.branch.repository.revision_store.get('A', 
266
 
                            'sig').read(),
267
 
                         d2.open_repository().revision_store.get('A', 
268
 
                            'sig').read())
 
268
        self.assertEqual(wt.branch.repository.get_signature_text('A'),
 
269
                         d2.open_repository().get_signature_text('A'))
269
270
 
270
271
    def test_nicks(self):
271
272
        """Branch nicknames"""
469
470
                                   transactions.ReadOnlyTransaction))
470
471
        self.get_branch().unlock()
471
472
        
472
 
    def test_lock_write_acquires_passthrough_transaction(self):
 
473
    def test_lock_write_acquires_write_transaction(self):
473
474
        self.get_branch().lock_write()
474
475
        # cannot use get_transaction as its magic
475
476
        self.failUnless(isinstance(self.get_branch().control_files._transaction,
476
 
                                   transactions.PassThroughTransaction))
 
477
                                   transactions.WriteTransaction))
477
478
        self.get_branch().unlock()
478
479
 
479
480