~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Parth Malwankar
  • Date: 2010-03-25 04:24:52 UTC
  • mto: This revision was merged to the branch mainline in revision 5166.
  • Revision ID: parth.malwankar@gmail.com-20100325042452-s27zhxa8y3vmbadi
initial support for 'pack --clean-obsolete-packs'. tested only manually.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1568
1568
        """Is the collection already packed?"""
1569
1569
        return not (self.repo._format.pack_compresses or (len(self._names) > 1))
1570
1570
 
1571
 
    def pack(self, hint=None):
 
1571
    def pack(self, hint=None, clean_obsolete_packs=False):
1572
1572
        """Pack the pack collection totally."""
1573
1573
        self.ensure_loaded()
1574
1574
        total_packs = len(self._names)
1590
1590
                pack_operations[-1][1].append(pack)
1591
1591
        self._execute_pack_operations(pack_operations, OptimisingPacker)
1592
1592
 
 
1593
        if clean_obsolete_packs:
 
1594
            self._clear_obsolete_packs()
 
1595
 
1593
1596
    def plan_autopack_combinations(self, existing_packs, pack_distribution):
1594
1597
        """Plan a pack operation.
1595
1598
 
2383
2386
        raise NotImplementedError(self.dont_leave_lock_in_place)
2384
2387
 
2385
2388
    @needs_write_lock
2386
 
    def pack(self, hint=None):
 
2389
    def pack(self, hint=None, clean_obsolete_packs=False):
2387
2390
        """Compress the data within the repository.
2388
2391
 
2389
2392
        This will pack all the data to a single pack. In future it may
2390
2393
        recompress deltas or do other such expensive operations.
2391
2394
        """
2392
 
        self._pack_collection.pack(hint=hint)
 
2395
        self._pack_collection.pack(hint=hint, clean_obsolete_packs=clean_obsolete_packs)
2393
2396
 
2394
2397
    @needs_write_lock
2395
2398
    def reconcile(self, other=None, thorough=False):