Logo Search packages:      
Sourcecode: obnam version File versions  Download package

def obnamlib::repo::Repository::_really_remove_generation (   self,
  gen_id 
) [private]
Really remove a committed generation.

This is not part of the public API.

This does not make any safety checks.

Definition at line 439 of file repo.py.

                                               :
        '''Really remove a committed generation.
        
        This is not part of the public API.
        
        This does not make any safety checks.
        
        '''


        def filter_away_chunks_used_by_other_gens(chunk_ids, gen_id):
            for other_id in self.list_generations():
                if other_id != gen_id:
                    other_chunks = self.client.list_chunks_in_generation(
                                        other_id)
                    chunk_ids = [chunk_id
                                 for chunk_id in chunk_ids
                                 if chunk_id not in other_chunks]
            return chunk_ids

        def remove_unused_chunks(chunk_ids):
            for chunk_id in chunk_ids:
                checksum = self.chunklist.get_checksum(chunk_id)
                self.chunksums.remove(checksum, chunk_id, 
                                      self.current_client_id)
                if not self.chunksums.chunk_is_used(checksum, chunk_id):
                    self.remove_chunk(chunk_id)

        self.require_client_lock()
        logging.debug('_really_remove_generation: %d' % gen_id)
        chunk_ids = self.client.list_chunks_in_generation(gen_id)
        chunk_ids = filter_away_chunks_used_by_other_gens(chunk_ids, gen_id)
        remove_unused_chunks(chunk_ids)
        self.client.remove_generation(gen_id)


Generated by  Doxygen 1.6.0   Back to index