~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-03-06 07:44:17 UTC
  • mfrom: (1553.5.64 bzr.mbp.locks)
  • Revision ID: pqm@pqm.ubuntu.com-20060306074417-344f1d83d99b9730
Integrate LockDirs into new format, etc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
27
27
 
28
28
import bzrlib
29
29
import bzrlib.errors as errors
30
 
from bzrlib.lockable_files import LockableFiles
 
30
from bzrlib.lockable_files import LockableFiles, TransportLock
31
31
from bzrlib.osutils import safe_unicode
32
32
from bzrlib.osutils import (
33
33
                            abspath,
536
536
        """See BzrDir.__init__."""
537
537
        super(BzrDirPreSplitOut, self).__init__(_transport, _format)
538
538
        self._control_files = LockableFiles(self.get_branch_transport(None),
539
 
                                            'branch-lock')
 
539
                                            'branch-lock',
 
540
                                            TransportLock)
540
541
 
541
542
    def clone(self, url, revision_id=None, basis=None, force_new_repo=False):
542
543
        """See BzrDir.clone()."""
864
865
        # Since we don't have a .bzr directory, inherit the
865
866
        # mode from the root directory
866
867
        t = get_transport(url)
867
 
        temp_control = LockableFiles(t, '')
 
868
        temp_control = LockableFiles(t, '', TransportLock)
868
869
        temp_control._transport.mkdir('.bzr',
869
870
                                      # FIXME: RBC 20060121 dont peek under
870
871
                                      # the covers
880
881
                      ('branch-format', self.get_format_string()),
881
882
                      ]
882
883
        # NB: no need to escape relative paths that are url safe.
883
 
        control.put(lock_file, StringIO(), mode=file_mode)
884
 
        control_files = LockableFiles(control, lock_file)
 
884
        control_files = LockableFiles(control, lock_file, TransportLock)
 
885
        control_files.create_lock()
885
886
        control_files.lock_write()
886
887
        try:
887
888
            for file, content in utf8_files: