/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Michael Ellerman
  • Date: 2006-03-09 00:24:48 UTC
  • mto: (1610.1.8 bzr.mbp.integration)
  • mto: This revision was merged to the branch mainline in revision 1616.
  • Revision ID: michael@ellerman.id.au-20060309002448-70cce15e3d605130
Make the "ignore line" in the commit message editor the "right" width, so
that if you make your message that wide it won't wrap in bzr log output.
Just as a visual aid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import bzrlib
21
21
from bzrlib.tests import TestCaseWithTransport
22
22
from bzrlib.branch import Branch
23
 
from bzrlib.bzrdir import BzrDir, BzrDirMetaFormat1
24
23
from bzrlib.workingtree import WorkingTree
25
24
from bzrlib.commit import Commit
26
25
from bzrlib.config import BranchConfig
27
 
from bzrlib.errors import (PointlessCommit, BzrError, SigningFailed, 
28
 
                           LockContention)
 
26
from bzrlib.errors import PointlessCommit, BzrError, SigningFailed
29
27
 
30
28
 
31
29
# TODO: Test commit with some added, and added-but-missing files
310
308
        wt = self.make_branch_and_tree('.')
311
309
        branch = wt.branch
312
310
        wt.commit("base", allow_pointless=True, rev_id='A')
313
 
        self.failIf(branch.repository.has_signature_for_revision_id('A'))
 
311
        self.failIf(branch.repository.revision_store.has_id('A', 'sig'))
314
312
        try:
315
313
            from bzrlib.testament import Testament
316
314
            # monkey patch gpg signing mechanism
321
319
                                                      working_tree=wt)
322
320
            self.assertEqual(Testament.from_revision(branch.repository,
323
321
                             'B').as_short_text(),
324
 
                             branch.repository.get_signature_text('B'))
 
322
                             branch.repository.revision_store.get('B', 
 
323
                                                               'sig').read())
325
324
        finally:
326
325
            bzrlib.gpg.GPGStrategy = oldstrategy
327
326
 
332
331
        wt = self.make_branch_and_tree('.')
333
332
        branch = wt.branch
334
333
        wt.commit("base", allow_pointless=True, rev_id='A')
335
 
        self.failIf(branch.repository.has_signature_for_revision_id('A'))
 
334
        self.failIf(branch.repository.revision_store.has_id('A', 'sig'))
336
335
        try:
337
336
            from bzrlib.testament import Testament
338
337
            # monkey patch gpg signing mechanism
346
345
                              working_tree=wt)
347
346
            branch = Branch.open(self.get_url('.'))
348
347
            self.assertEqual(branch.revision_history(), ['A'])
349
 
            self.failIf(branch.repository.has_revision('B'))
 
348
            self.failIf(branch.repository.revision_store.has_id('B'))
350
349
        finally:
351
350
            bzrlib.gpg.GPGStrategy = oldstrategy
352
351
 
378
377
                         wt.branch.repository.get_revision(
379
378
                            wt.branch.last_revision()).properties)
380
379
 
381
 
    def test_safe_master_lock(self):
382
 
        os.mkdir('master')
383
 
        master = BzrDirMetaFormat1().initialize('master')
384
 
        master.create_repository()
385
 
        master_branch = master.create_branch()
386
 
        master.create_workingtree()
387
 
        bound = master.sprout('bound')
388
 
        wt = bound.open_workingtree()
389
 
        wt.branch.set_bound_location(os.path.realpath('master'))
390
 
        master_branch.lock_write()
391
 
        try:
392
 
            self.assertRaises(LockContention, wt.commit, 'silly')
393
 
        finally:
394
 
            master_branch.unlock()
 
380