~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Aaron Bentley
  • Date: 2007-01-11 03:46:53 UTC
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070111034653-wa1n3uy49wbvom5m
Remove get_format_*, make FormatRegistry.register_metadir vary working tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
1977
1977
        return to_convert
1978
1978
 
1979
1979
 
1980
 
def get_knit1_format():
1981
 
    from bzrlib import repository
1982
 
    format = BzrDirMetaFormat1()
1983
 
    format.repository_format = repository.RepositoryFormatKnit1()
1984
 
    return format
1985
 
 
1986
 
 
1987
 
def get_knit2_format():
1988
 
    from bzrlib import repository
1989
 
    format = BzrDirMetaFormat1()
1990
 
    format.repository_format = repository.RepositoryFormatKnit2()
1991
 
    return format
1992
 
 
1993
 
def get_knit3_format():
1994
 
    from bzrlib import repository, workingtree
1995
 
    format = BzrDirMetaFormat1()
1996
 
    format.repository_format = repository.RepositoryFormatKnit2()
1997
 
    format.workingtree_format = workingtree.WorkingTreeFormat4()
1998
 
    return format
1999
 
 
2000
 
 
2001
1980
class BzrDirFormatInfo(object):
2002
1981
 
2003
1982
    def __init__(self, native, deprecated):
2012
1991
    e.g. BzrDirMeta1 with weave repository.  Also, it's more user-oriented.
2013
1992
    """
2014
1993
 
2015
 
    def register_metadir(self, key, repo, help, native=True, deprecated=False):
 
1994
    def register_metadir(self, key, repo, help, native=True, deprecated=False,
 
1995
                         tree='WorkingTreeFormat3'):
2016
1996
        """Register a metadir subformat.
2017
1997
        
2018
1998
        repo is the repository format name as a string.
2021
2001
        # formats, once BzrDirMetaFormat1 supports that.
2022
2002
        def helper():
2023
2003
            import bzrlib.repository
 
2004
            import bzrlib.workingtree
2024
2005
            repo_format = getattr(bzrlib.repository, repo)
 
2006
            tree_format = getattr(bzrlib.workingtree, tree)
2025
2007
            bd = BzrDirMetaFormat1()
2026
2008
            bd.repository_format = repo_format()
 
2009
            bd.workingtree_format = tree_format()
2027
2010
            return bd
2028
2011
        self.register(key, helper, help, native, deprecated)
2029
2012
 
2126
2109
    deprecated=True)
2127
2110
format_registry.register_metadir('experimental-knit2', 'RepositoryFormatKnit2',
2128
2111
    'Experimental successor to knit.  Use at your own risk.')
 
2112
format_registry.register_metadir('experimental-knit3', 'RepositoryFormatKnit2',
 
2113
    'Experimental successor to knit2.  Use at your own risk.', 
 
2114
    tree='WorkingTreeFormat4')