~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-02-19 01:40:45 UTC
  • mfrom: (3152.2.3 experimental)
  • Revision ID: pqm@pqm.ubuntu.com-20080219014045-w3igijttjdcpwshz
(robertc) Add development formats and methodology. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2249
2249
    def get_format_description(self):
2250
2250
        """See RepositoryFormat.get_format_description()."""
2251
2251
        return "Packs containing knits with rich root support\n"
 
2252
 
 
2253
 
 
2254
class RepositoryFormatPackDevelopment0(RepositoryFormatPack):
 
2255
    """A no-subtrees development repository.
 
2256
 
 
2257
    This format should be retained until the second release after bzr 1.0.
 
2258
 
 
2259
    No changes to the disk behaviour from pack-0.92.
 
2260
    """
 
2261
 
 
2262
    repository_class = KnitPackRepository
 
2263
    _commit_builder_class = PackCommitBuilder
 
2264
    _serializer = xml5.serializer_v5
 
2265
 
 
2266
    def _get_matching_bzrdir(self):
 
2267
        return bzrdir.format_registry.make_bzrdir('development0')
 
2268
 
 
2269
    def _ignore_setting_bzrdir(self, format):
 
2270
        pass
 
2271
 
 
2272
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
 
2273
 
 
2274
    def get_format_string(self):
 
2275
        """See RepositoryFormat.get_format_string()."""
 
2276
        return "Bazaar development format 0 (needs bzr.dev from before 1.3)\n"
 
2277
 
 
2278
    def get_format_description(self):
 
2279
        """See RepositoryFormat.get_format_description()."""
 
2280
        return ("Development repository format, currently the same as "
 
2281
            "pack-0.92\n")
 
2282
 
 
2283
    def check_conversion_target(self, target_format):
 
2284
        pass
 
2285
 
 
2286
 
 
2287
class RepositoryFormatPackDevelopment0Subtree(RepositoryFormatPack):
 
2288
    """A subtrees development repository.
 
2289
 
 
2290
    This format should be retained until the second release after bzr 1.0.
 
2291
 
 
2292
    No changes to the disk behaviour from pack-0.92-subtree.
 
2293
    """
 
2294
 
 
2295
    repository_class = KnitPackRepository
 
2296
    _commit_builder_class = PackRootCommitBuilder
 
2297
    rich_root_data = True
 
2298
    supports_tree_reference = True
 
2299
    _serializer = xml7.serializer_v7
 
2300
 
 
2301
    def _get_matching_bzrdir(self):
 
2302
        return bzrdir.format_registry.make_bzrdir(
 
2303
            'development0-subtree')
 
2304
 
 
2305
    def _ignore_setting_bzrdir(self, format):
 
2306
        pass
 
2307
 
 
2308
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
 
2309
 
 
2310
    def check_conversion_target(self, target_format):
 
2311
        if not target_format.rich_root_data:
 
2312
            raise errors.BadConversionTarget(
 
2313
                'Does not support rich root data.', target_format)
 
2314
        if not getattr(target_format, 'supports_tree_reference', False):
 
2315
            raise errors.BadConversionTarget(
 
2316
                'Does not support nested trees', target_format)
 
2317
            
 
2318
    def get_format_string(self):
 
2319
        """See RepositoryFormat.get_format_string()."""
 
2320
        return ("Bazaar development format 0 with subtree support "
 
2321
            "(needs bzr.dev from before 1.3)\n")
 
2322
 
 
2323
    def get_format_description(self):
 
2324
        """See RepositoryFormat.get_format_description()."""
 
2325
        return ("Development repository format, currently the same as "
 
2326
            "pack-0.92-subtree\n")
 
2327
 
 
2328