~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2006-03-06 05:01:35 UTC
  • mto: This revision was merged to the branch mainline in revision 1593.
  • Revision ID: mbp@sourcefrog.net-20060306050135-9e422a1633679d5f
Lock type is now mandatory for LockableFiles constructor

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
                           NoWorkingTree)
48
48
import bzrlib.inventory as inventory
49
49
from bzrlib.inventory import Inventory
50
 
from bzrlib.lockable_files import LockableFiles
 
50
from bzrlib.lockable_files import LockableFiles, TransportLock
51
51
from bzrlib.osutils import (isdir, quotefn,
52
52
                            rename, splitpath, sha_file,
53
53
                            file_kind, abspath, normpath, pathjoin,
579
579
        utf8_files = [('revision-history', ''),
580
580
                      ('branch-name', ''),
581
581
                      ]
582
 
        control_files = LockableFiles(branch_transport, 'branch-lock')
 
582
        control_files = LockableFiles(branch_transport, 'branch-lock',
 
583
                                      TransportLock)
 
584
        control_files.create_lock()
583
585
        control_files.lock_write()
584
586
        try:
585
587
            for file, content in utf8_files:
629
631
        utf8_files = [('revision-history', ''),
630
632
                      ('branch-name', ''),
631
633
                      ]
632
 
        lock_file = 'lock'
633
 
        branch_transport.put(lock_file, StringIO()) # TODO get the file mode from the bzrdir lock files., mode=file_mode)
634
 
        control_files = LockableFiles(branch_transport, 'lock')
 
634
        control_files = LockableFiles(branch_transport, 'lock', TransportLock)
 
635
        control_files.create_lock()
635
636
        control_files.lock_write()
636
637
        control_files.put_utf8('format', self.get_format_string())
637
638
        try:
655
656
            format = BranchFormat.find_format(a_bzrdir)
656
657
            assert format.__class__ == self.__class__
657
658
        transport = a_bzrdir.get_branch_transport(None)
658
 
        control_files = LockableFiles(transport, 'lock')
 
659
        control_files = LockableFiles(transport, 'lock', TransportLock)
659
660
        return BzrBranch(_format=self,
660
661
                         _control_files=control_files,
661
662
                         a_bzrdir=a_bzrdir,