~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Patch Queue Manager
  • Date: 2012-01-23 15:31:35 UTC
  • mfrom: (6443.1.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20120123153135-8v3r3z1lx055vmpl
(jelmer) Merge the 2.5 series branch. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
887
887
        format = BranchFormatMetadir.find_format(self, name=name)
888
888
        return format.get_reference(self, name=name)
889
889
 
 
890
    def set_branch_reference(self, target_branch, name=None):
 
891
        format = _mod_branch.BranchReferenceFormat()
 
892
        return format.initialize(self, target_branch=target_branch, name=name)
 
893
 
890
894
    def get_branch_transport(self, branch_format, name=None):
891
895
        """See BzrDir.get_branch_transport()."""
892
896
        if name is None:
1471
1475
        # mode from the root directory
1472
1476
        temp_control = lockable_files.LockableFiles(transport,
1473
1477
                            '', lockable_files.TransportLock)
1474
 
        temp_control._transport.mkdir('.bzr',
1475
 
                                      # FIXME: RBC 20060121 don't peek under
1476
 
                                      # the covers
1477
 
                                      mode=temp_control._dir_mode)
 
1478
        try:
 
1479
            temp_control._transport.mkdir('.bzr',
 
1480
                # FIXME: RBC 20060121 don't peek under
 
1481
                # the covers
 
1482
                mode=temp_control._dir_mode)
 
1483
        except errors.FileExists:
 
1484
            raise errors.AlreadyControlDirError(transport.base)
1478
1485
        if sys.platform == 'win32' and isinstance(transport, local.LocalTransport):
1479
1486
            win32utils.set_file_attr_hidden(transport._abspath('.bzr'))
1480
1487
        file_mode = temp_control._file_mode