96
96
def get_format_type(typestring):
97
97
"""Parse and return a format specifier."""
98
if typestring == "weave":
99
return bzrdir.BzrDirFormat6()
98
# Have to use BzrDirMetaFormat1 directly, so that
99
# RepositoryFormat.set_default_format works
100
100
if typestring == "default":
101
101
return bzrdir.BzrDirMetaFormat1()
102
if typestring == "metaweave":
103
format = bzrdir.BzrDirMetaFormat1()
104
format.repository_format = repository.RepositoryFormat7()
106
if typestring == "knit":
107
format = bzrdir.BzrDirMetaFormat1()
108
format.repository_format = repository.RepositoryFormatKnit1()
110
if typestring == "experimental-knit2":
111
format = bzrdir.BzrDirMetaFormat1()
112
format.repository_format = repository.RepositoryFormatKnit2()
114
msg = "Unknown bzr format %s. Current formats are: default, knit,\n" \
115
"metaweave and weave" % typestring
116
raise errors.BzrCommandError(msg)
103
return bzrdir.format_registry.make_bzrdir(typestring)
105
msg = 'Unknown bzr format "%s". See "bzr help formats".' % typestring
106
raise errors.BzrCommandError(msg)
119
109
# TODO: Make sure no commands unconditionally use the working directory as a