~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Merge repository so I dont trample on myself.

Show diffs side-by-side

added added

removed removed

Lines of Context:
601
601
        control_files = LockableFiles(transport, 'branch-lock')
602
602
        return BzrBranch(_format=self,
603
603
                         _control_files=control_files,
604
 
                         a_bzrdir=a_bzrdir)
 
604
                         a_bzrdir=a_bzrdir,
 
605
                         _repository=a_bzrdir.open_repository())
605
606
 
606
607
 
607
608
class BzrBranchFormat5(BranchFormat):
610
611
    This format has:
611
612
     - a revision-history file.
612
613
     - a format string
613
 
     - a lock lock file.
 
614
     - a lock file.
 
615
     - works with shared repositories.
614
616
    """
615
617
 
616
618
    def get_format_string(self):
654
656
        control_files = LockableFiles(transport, 'lock')
655
657
        return BzrBranch(_format=self,
656
658
                         _control_files=control_files,
657
 
                         a_bzrdir=a_bzrdir)
 
659
                         a_bzrdir=a_bzrdir,
 
660
                         _repository=a_bzrdir.find_repository())
658
661
 
659
662
 
660
663
class BranchReferenceFormat(BranchFormat):
752
755
 
753
756
    def __init__(self, transport=DEPRECATED_PARAMETER, init=DEPRECATED_PARAMETER,
754
757
                 relax_version_check=DEPRECATED_PARAMETER, _format=None,
755
 
                 _control_files=None, a_bzrdir=None):
 
758
                 _control_files=None, a_bzrdir=None, _repository=None):
756
759
        """Create new branch object at a particular location.
757
760
 
758
761
        transport -- A Transport object, defining how to access files.
806
809
                 "Please use Branch.open, or bzrdir.open_branch().",
807
810
                 DeprecationWarning,
808
811
                 stacklevel=2)
809
 
        # TODO change this to search upwards if needed.
810
 
        self.repository = self.bzrdir.open_repository()
 
812
        self.repository = _repository
811
813
 
812
814
    def __str__(self):
813
815
        return '%s(%r)' % (self.__class__.__name__, self.base)