1722
1722
self._fetch_order = 'unordered'
1724
1724
def _warn_if_deprecated(self):
1725
# This class isn't deprecated
1725
# This class isn't deprecated, but one sub-format is
1726
if isinstance(self._format, RepositoryFormatKnitPack5RichRootBroken):
1727
from bzrlib import repository
1728
if repository._deprecation_warning_done:
1730
repository._deprecation_warning_done = True
1731
warning("Format %s for %s is deprecated - please use"
1732
" 'bzr upgrade --1.6.1-rich-root'"
1733
% (self._format, self.bzrdir.transport.base))
1728
1735
def _abort_write_group(self):
1729
1736
self._pack_collection._abort_write_group()
2088
2095
class RepositoryFormatKnitPack5RichRoot(RepositoryFormatPack):
2096
"""A repository with rich roots and stacking.
2098
New in release 1.6.1.
2100
Supports stacking on other repositories, allowing data to be accessed
2101
without being stored locally.
2104
repository_class = KnitPackRepository
2105
_commit_builder_class = PackRootCommitBuilder
2106
rich_root_data = True
2107
supports_tree_reference = False # no subtrees
2108
_serializer = xml6.serializer_v6
2109
supports_external_lookups = True
2111
def _get_matching_bzrdir(self):
2112
return bzrdir.format_registry.make_bzrdir(
2115
def _ignore_setting_bzrdir(self, format):
2118
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2120
def check_conversion_target(self, target_format):
2121
if not target_format.rich_root_data:
2122
raise errors.BadConversionTarget(
2123
'Does not support rich root data.', target_format)
2125
def get_format_string(self):
2126
"""See RepositoryFormat.get_format_string()."""
2127
return "Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6.1)\n"
2129
def get_format_description(self):
2130
return "Packs 5 rich-root (adds stacking support, requires bzr 1.6.1)"
2133
class RepositoryFormatKnitPack5RichRootBroken(RepositoryFormatPack):
2089
2134
"""A repository with rich roots and external references.
2091
2136
New in release 1.6.
2093
2138
Supports external lookups, which results in non-truncated ghosts after
2094
2139
reconcile compared to pack-0.92 formats.
2141
This format was deprecated because the serializer it uses accidentally
2142
supported subtrees, when the format was not intended to. This meant that
2143
someone could accidentally fetch from an incorrect repository.
2097
2146
repository_class = KnitPackRepository
2115
2164
if not target_format.rich_root_data:
2116
2165
raise errors.BadConversionTarget(
2117
2166
'Does not support rich root data.', target_format)
2119
2168
def get_format_string(self):
2120
2169
"""See RepositoryFormat.get_format_string()."""
2121
2170
return "Bazaar RepositoryFormatKnitPack5RichRoot (bzr 1.6)\n"
2123
2172
def get_format_description(self):
2124
return "Packs 5 rich-root (adds stacking support, requires bzr 1.6)"
2127
class RepositoryFormatPackDevelopment0(RepositoryFormatPack):
2128
"""A no-subtrees development repository.
2130
This format should be retained until the second release after bzr 1.0.
2132
No changes to the disk behaviour from pack-0.92.
2135
repository_class = KnitPackRepository
2136
_commit_builder_class = PackCommitBuilder
2137
_serializer = xml5.serializer_v5
2139
def _get_matching_bzrdir(self):
2140
return bzrdir.format_registry.make_bzrdir('development0')
2142
def _ignore_setting_bzrdir(self, format):
2145
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2147
def get_format_string(self):
2148
"""See RepositoryFormat.get_format_string()."""
2149
return "Bazaar development format 0 (needs bzr.dev from before 1.3)\n"
2151
def get_format_description(self):
2152
"""See RepositoryFormat.get_format_description()."""
2153
return ("Development repository format, currently the same as "
2156
def check_conversion_target(self, target_format):
2160
class RepositoryFormatPackDevelopment0Subtree(RepositoryFormatPack):
2161
"""A subtrees development repository.
2163
This format should be retained until the second release after bzr 1.0.
2165
No changes to the disk behaviour from pack-0.92-subtree.
2168
repository_class = KnitPackRepository
2169
_commit_builder_class = PackRootCommitBuilder
2170
rich_root_data = True
2171
supports_tree_reference = True
2172
_serializer = xml7.serializer_v7
2174
def _get_matching_bzrdir(self):
2175
return bzrdir.format_registry.make_bzrdir(
2176
'development0-subtree')
2178
def _ignore_setting_bzrdir(self, format):
2181
_matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
2183
def check_conversion_target(self, target_format):
2184
if not target_format.rich_root_data:
2185
raise errors.BadConversionTarget(
2186
'Does not support rich root data.', target_format)
2187
if not getattr(target_format, 'supports_tree_reference', False):
2188
raise errors.BadConversionTarget(
2189
'Does not support nested trees', target_format)
2191
def get_format_string(self):
2192
"""See RepositoryFormat.get_format_string()."""
2193
return ("Bazaar development format 0 with subtree support "
2194
"(needs bzr.dev from before 1.3)\n")
2196
def get_format_description(self):
2197
"""See RepositoryFormat.get_format_description()."""
2198
return ("Development repository format, currently the same as "
2199
"pack-0.92-subtree\n")
2202
class RepositoryFormatPackDevelopment1(RepositoryFormatPackDevelopment0):
2173
return ("Packs 5 rich-root (adds stacking support, requires bzr 1.6)"
2177
class RepositoryFormatPackDevelopment1(RepositoryFormatPack):
2203
2178
"""A no-subtrees development repository.
2205
2180
This format should be retained until the second release after bzr 1.5.