~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-03-21 22:04:28 UTC
  • mfrom: (1614.1.1 bzr.masterborked)
  • Revision ID: pqm@pqm.ubuntu.com-20060321220428-480db3eb2b5cd932
Fixed master locking in commit

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
23
24
from bzrlib.workingtree import WorkingTree
24
25
from bzrlib.commit import Commit
25
26
from bzrlib.config import BranchConfig
26
 
from bzrlib.errors import PointlessCommit, BzrError, SigningFailed
 
27
from bzrlib.errors import (PointlessCommit, BzrError, SigningFailed, 
 
28
                           LockContention)
27
29
 
28
30
 
29
31
# TODO: Test commit with some added, and added-but-missing files
376
378
                         wt.branch.repository.get_revision(
377
379
                            wt.branch.last_revision()).properties)
378
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
        self.assertRaises(LockContention, wt.commit, 'silly')