/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: Martin Pool
  • Date: 2010-04-28 07:03:38 UTC
  • mfrom: (5188 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5189.
  • Revision ID: mbp@sourcefrog.net-20100428070338-2af8y3takgfkrkyp
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1560
1560
        """Is the collection already packed?"""
1561
1561
        return not (self.repo._format.pack_compresses or (len(self._names) > 1))
1562
1562
 
1563
 
    def pack(self, hint=None):
 
1563
    def pack(self, hint=None, clean_obsolete_packs=False):
1564
1564
        """Pack the pack collection totally."""
1565
1565
        self.ensure_loaded()
1566
1566
        total_packs = len(self._names)
1582
1582
                pack_operations[-1][1].append(pack)
1583
1583
        self._execute_pack_operations(pack_operations, OptimisingPacker)
1584
1584
 
 
1585
        if clean_obsolete_packs:
 
1586
            self._clear_obsolete_packs()
 
1587
 
1585
1588
    def plan_autopack_combinations(self, existing_packs, pack_distribution):
1586
1589
        """Plan a pack operation.
1587
1590
 
2375
2378
        raise NotImplementedError(self.dont_leave_lock_in_place)
2376
2379
 
2377
2380
    @needs_write_lock
2378
 
    def pack(self, hint=None):
 
2381
    def pack(self, hint=None, clean_obsolete_packs=False):
2379
2382
        """Compress the data within the repository.
2380
2383
 
2381
2384
        This will pack all the data to a single pack. In future it may
2382
2385
        recompress deltas or do other such expensive operations.
2383
2386
        """
2384
 
        self._pack_collection.pack(hint=hint)
 
2387
        self._pack_collection.pack(hint=hint, clean_obsolete_packs=clean_obsolete_packs)
2385
2388
 
2386
2389
    @needs_write_lock
2387
2390
    def reconcile(self, other=None, thorough=False):
2543
2546
        utf8_files = [('format', self.get_format_string())]
2544
2547
 
2545
2548
        self._upload_blank_content(a_bzrdir, dirs, files, utf8_files, shared)
2546
 
        return self.open(a_bzrdir=a_bzrdir, _found=True)
 
2549
        repository = self.open(a_bzrdir=a_bzrdir, _found=True)
 
2550
        self._run_post_repo_init_hooks(repository, a_bzrdir, shared)
 
2551
        return repository
2547
2552
 
2548
2553
    def open(self, a_bzrdir, _found=False, _override_transport=None):
2549
2554
        """See RepositoryFormat.open().