/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/repofmt/pack_repo.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-12 20:13:07 UTC
  • mfrom: (3267 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080312201307-ngd5bynt2nvhnlb7
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
641
641
        # at this point.
642
642
        self.pb.update("Copying inventory texts", 2)
643
643
        total_items, readv_group_iter = self._least_readv_node_readv(inv_nodes)
 
644
        # Only grab the output lines if we will be processing them
 
645
        output_lines = bool(self.revision_ids)
644
646
        inv_lines = self._copy_nodes_graph(inventory_index_map,
645
647
            self.new_pack._writer, self.new_pack.inventory_index,
646
 
            readv_group_iter, total_items, output_lines=True)
 
648
            readv_group_iter, total_items, output_lines=output_lines)
647
649
        if self.revision_ids:
648
650
            self._process_inventory_lines(inv_lines)
649
651
        else:
655
657
                time.ctime(), self._pack_collection._upload_transport.base,
656
658
                self.new_pack.random_name,
657
659
                self.new_pack.inventory_index.key_count(),
658
 
                time.time() - new_pack.start_time)
 
660
                time.time() - self.new_pack.start_time)
659
661
 
660
662
    def _copy_text_texts(self):
661
663
        # select text keys
2054
2056
    # Set this attribute in derived clases to control the _serializer that the
2055
2057
    # repository objects will have passed to their constructor.
2056
2058
    _serializer = None
 
2059
    # External references are not supported in pack repositories yet.
 
2060
    supports_external_lookups = False
2057
2061
 
2058
2062
    def _get_control_store(self, repo_transport, control_files):
2059
2063
        """Return the control store for this repository."""
2254
2258
    def get_format_description(self):
2255
2259
        """See RepositoryFormat.get_format_description()."""
2256
2260
        return "Packs containing knits with rich root support\n"
 
2261
 
 
2262
 
 
2263
class RepositoryFormatPackDevelopment0(RepositoryFormatPack):
 
2264
    """A no-subtrees development repository.
 
2265
 
 
2266
    This format should be retained until the second release after bzr 1.0.
 
2267
 
 
2268
    No changes to the disk behaviour from pack-0.92.
 
2269
    """
 
2270
 
 
2271
    repository_class = KnitPackRepository
 
2272
    _commit_builder_class = PackCommitBuilder
 
2273
    _serializer = xml5.serializer_v5
 
2274
 
 
2275
    def _get_matching_bzrdir(self):
 
2276
        return bzrdir.format_registry.make_bzrdir('development0')
 
2277
 
 
2278
    def _ignore_setting_bzrdir(self, format):
 
2279
        pass
 
2280
 
 
2281
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
 
2282
 
 
2283
    def get_format_string(self):
 
2284
        """See RepositoryFormat.get_format_string()."""
 
2285
        return "Bazaar development format 0 (needs bzr.dev from before 1.3)\n"
 
2286
 
 
2287
    def get_format_description(self):
 
2288
        """See RepositoryFormat.get_format_description()."""
 
2289
        return ("Development repository format, currently the same as "
 
2290
            "pack-0.92\n")
 
2291
 
 
2292
    def check_conversion_target(self, target_format):
 
2293
        pass
 
2294
 
 
2295
 
 
2296
class RepositoryFormatPackDevelopment0Subtree(RepositoryFormatPack):
 
2297
    """A subtrees development repository.
 
2298
 
 
2299
    This format should be retained until the second release after bzr 1.0.
 
2300
 
 
2301
    No changes to the disk behaviour from pack-0.92-subtree.
 
2302
    """
 
2303
 
 
2304
    repository_class = KnitPackRepository
 
2305
    _commit_builder_class = PackRootCommitBuilder
 
2306
    rich_root_data = True
 
2307
    supports_tree_reference = True
 
2308
    _serializer = xml7.serializer_v7
 
2309
 
 
2310
    def _get_matching_bzrdir(self):
 
2311
        return bzrdir.format_registry.make_bzrdir(
 
2312
            'development0-subtree')
 
2313
 
 
2314
    def _ignore_setting_bzrdir(self, format):
 
2315
        pass
 
2316
 
 
2317
    _matchingbzrdir = property(_get_matching_bzrdir, _ignore_setting_bzrdir)
 
2318
 
 
2319
    def check_conversion_target(self, target_format):
 
2320
        if not target_format.rich_root_data:
 
2321
            raise errors.BadConversionTarget(
 
2322
                'Does not support rich root data.', target_format)
 
2323
        if not getattr(target_format, 'supports_tree_reference', False):
 
2324
            raise errors.BadConversionTarget(
 
2325
                'Does not support nested trees', target_format)
 
2326
            
 
2327
    def get_format_string(self):
 
2328
        """See RepositoryFormat.get_format_string()."""
 
2329
        return ("Bazaar development format 0 with subtree support "
 
2330
            "(needs bzr.dev from before 1.3)\n")
 
2331
 
 
2332
    def get_format_description(self):
 
2333
        """See RepositoryFormat.get_format_description()."""
 
2334
        return ("Development repository format, currently the same as "
 
2335
            "pack-0.92-subtree\n")
 
2336
 
 
2337