/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Aaron Bentley
  • Date: 2007-01-12 18:18:41 UTC
  • mto: (2230.3.47 branch6)
  • mto: This revision was merged to the branch mainline in revision 2290.
  • Revision ID: abentley@panoramicfeedback.com-20070112181841-94zoz6cv72clmsft
Get branch6 creation working

Show diffs side-by-side

added added

removed removed

Lines of Context:
906
906
 
907
907
    def create_branch(self):
908
908
        """See BzrDir.create_branch."""
909
 
        from bzrlib.branch import BranchFormat
910
 
        return BranchFormat.get_default_format().initialize(self)
 
909
        return self._format.branch_format.initialize(self)
911
910
 
912
911
    def create_repository(self, shared=False):
913
912
        """See BzrDir.create_repository."""
1420
1419
 
1421
1420
    _lock_class = lockdir.LockDir
1422
1421
 
 
1422
    def __init__(self):
 
1423
        self._branch_format = None
 
1424
 
 
1425
    def _get_branch_format(self):
 
1426
        if self._branch_format is None:
 
1427
            from bzrlib.branch import BranchFormat
 
1428
            self._branch_format = BranchFormat.get_default_format()
 
1429
        return self._branch_format
 
1430
 
 
1431
    def _set_branch_format(self, format):
 
1432
        self._branch_format = format
 
1433
 
 
1434
    branch_format = property(_get_branch_format, _set_branch_format)
 
1435
 
1423
1436
    def get_converter(self, format=None):
1424
1437
        """See BzrDirFormat.get_converter()."""
1425
1438
        if format is None:
1967
1980
    e.g. BzrDirMeta1 with weave repository.  Also, it's more user-oriented.
1968
1981
    """
1969
1982
 
1970
 
    def register_metadir(self, key, repo, help, native=True, deprecated=False):
 
1983
    def register_metadir(self, key, repo, help, native=True, deprecated=False,
 
1984
                         branch_format=None):
1971
1985
        """Register a metadir subformat.
1972
1986
        
1973
1987
        repo is the repository format name as a string.
1976
1990
        # formats, once BzrDirMetaFormat1 supports that.
1977
1991
        def helper():
1978
1992
            import bzrlib.repository
 
1993
            import bzrlib.branch
1979
1994
            repo_format = getattr(bzrlib.repository, repo)
1980
1995
            bd = BzrDirMetaFormat1()
1981
1996
            bd.repository_format = repo_format()
 
1997
            if branch_format is not None:
 
1998
                bd.branch_format =  getattr(bzrlib.branch, branch_format)()
1982
1999
            return bd
1983
2000
        self.register(key, helper, help, native, deprecated)
1984
2001
 
2081
2098
    deprecated=True)
2082
2099
format_registry.register_metadir('experimental-knit2', 'RepositoryFormatKnit2',
2083
2100
    'Experimental successor to knit.  Use at your own risk.')
 
2101
format_registry.register_metadir('experimental-branch6', 
 
2102
    'RepositoryFormatKnit2',
 
2103
    'Experimental successor to knit.  Use at your own risk.', 
 
2104
    branch_format='BzrBranchFormat6')