~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-12 00:43:17 UTC
  • mfrom: (5582.4.3 presplitoutbzrbranch)
  • Revision ID: pqm@pqm.ubuntu.com-20110112004317-81kxafod33p5lqal
(jelmer) Remove some hardcoded dependencies on weave-era formats in bzrlib
 and clean up more imports. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1380
1380
        """Return the most suitable metadir for a checkout of this branch.
1381
1381
        Weaves are used if this branch's repository uses weaves.
1382
1382
        """
1383
 
        if isinstance(self.bzrdir, bzrdir.BzrDirPreSplitOut):
1384
 
            from bzrlib.repofmt import weaverepo
1385
 
            format = bzrdir.BzrDirMetaFormat1()
1386
 
            format.repository_format = weaverepo.RepositoryFormat7()
1387
 
        else:
1388
 
            format = self.repository.bzrdir.checkout_metadir()
1389
 
            format.set_branch_format(self._format)
 
1383
        format = self.repository.bzrdir.checkout_metadir()
 
1384
        format.set_branch_format(self._format)
1390
1385
        return format
1391
1386
 
1392
1387
    def create_clone_on_transport(self, to_transport, revision_id=None,
2057
2052
            raise NotImplementedError
2058
2053
        if found_repository is None:
2059
2054
            found_repository = a_bzrdir.open_repository()
2060
 
        return BzrBranch(_format=self,
 
2055
        return BzrBranchPreSplitOut(_format=self,
2061
2056
                         _control_files=a_bzrdir._control_files,
2062
2057
                         a_bzrdir=a_bzrdir,
2063
2058
                         name=name,
2698
2693
                mode=self.bzrdir._get_file_mode())
2699
2694
 
2700
2695
 
 
2696
class BzrBranchPreSplitOut(BzrBranch):
 
2697
 
 
2698
    def _get_checkout_format(self):
 
2699
        """Return the most suitable metadir for a checkout of this branch.
 
2700
        Weaves are used if this branch's repository uses weaves.
 
2701
        """
 
2702
        from bzrlib.repofmt.weaverepo import RepositoryFormat7
 
2703
        from bzrlib.bzrdir import BzrDirMetaFormat1
 
2704
        format = BzrDirMetaFormat1()
 
2705
        format.repository_format = RepositoryFormat7()
 
2706
        return format
 
2707
 
 
2708
 
2701
2709
class BzrBranch5(BzrBranch):
2702
2710
    """A format 5 branch. This supports new features over plain branches.
2703
2711