Part of bzrlib.repofmt.pack_repo View In Hierarchy
Known subclasses: bzrlib.repofmt.groupcompress_repo.GCRepositoryPackCollection, bzrlib.repofmt.knitpack_repo.KnitRepositoryPackCollection
Instance Variables | _names | map of {pack_name: (index_size,)} |
Method | __init__ | Create a new RepositoryPackCollection. |
Method | __repr__ | Undocumented |
Method | add_pack_to_memory | Make a Pack object available to the repository to satisfy queries. |
Method | all_packs | Return a list of all the Pack objects this repository has. |
Method | autopack | Pack the pack collection incrementally. |
Method | lock_names | Acquire the mutex around the pack-names index. |
Method | pack | Pack the pack collection totally. |
Method | plan_autopack_combinations | Plan a pack operation. |
Method | ensure_loaded | Ensure we have read names from disk. |
Method | get_pack_by_name | Get a Pack object by name. |
Method | allocate | Allocate name in the list of packs. |
Method | names | Provide an order to the underlying names. |
Method | pack_distribution | Generate a list of the number of revisions to put in each pack. |
Method | reset | Clear all cached data. |
Method | reload_pack_names | Sync our pack listing with what is present in the repository. |
Method | _do_autopack | Undocumented |
Method | _execute_pack_operations | Execute a series of pack operations. |
Method | _flush_new_pack | Undocumented |
Method | _already_packed | Is the collection already packed? |
Method | _try_pack_operations | Calculate the pack operations based on the hint (if any), and |
Method | _parse_index_sizes | Parse a string of index sizes. |
Method | _resume_pack | Get a suspended Pack object by name. |
Method | _iter_disk_pack_index | Iterate over the contents of the pack-names index. |
Method | _make_index | Undocumented |
Method | _max_pack_count | Return the maximum number of packs to use for total revisions. |
Method | _obsolete_packs | Move a number of packs which have been obsoleted out of the way. |
Method | _pack_tuple | Return a tuple with the transport and file name for a pack name. |
Method | _remove_pack_from_memory | Remove pack from the packs accessed by this repository. |
Method | _remove_pack_indices | Remove the indices for pack from the aggregated indices. |
Method | _unlock_names | Release the mutex around the pack-names index. |
Method | _diff_pack_names | Read the pack names from disk, and compare it to the one in memory. |
Method | _syncronize_pack_names_from_disk_nodes | Given the correct set of pack files, update our saved info. |
Method | _save_pack_names | Save the list of packs. |
Method | _restart_autopack | Reload the pack names list, and restart the autopack code. |
Method | _restart_pack_operations | Reload the pack names list, and restart the autopack code. |
Method | _clear_obsolete_packs | Delete everything from the obsolete-packs directory. |
Method | _start_write_group | Undocumented |
Method | _abort_write_group | Undocumented |
Method | _remove_resumed_pack_indices | Undocumented |
Method | _check_new_inventories | Detect missing inventories in this write group. |
Method | _commit_write_group | Undocumented |
Method | _suspend_write_group | Undocumented |
Method | _resume_write_group | Undocumented |
Parameters | transport | Addresses the repository base directory (typically .bzr/repository/). |
index_transport | Addresses the directory containing indices. | |
upload_transport | Addresses the directory into which packs are written while they're being created. | |
pack_transport | Addresses the directory of existing complete packs. | |
index_builder_class | The index builder class to use. | |
index_class | The index class to use. | |
use_chk_index | Whether to setup and manage a CHK index. |
Parameters | pack | A Pack object. |
Note that an in-progress pack being created is not returned.
Returns | A list of Pack objects for all the packs in the repository. |
This will not attempt global reorganisation or recompression, rather it will just ensure that the total number of packs does not grow without bound. It uses the _max_pack_count method to determine if autopacking is needed, and the pack_distribution method to determine the number of revisions in each pack.
If autopacking takes place then the packs name collection will have been flushed to disk - packing requires updating the name collection in synchronisation with certain steps. Otherwise the names collection is not flushed.
Returns | Something evaluating true if packing took place. |
Parameters | pack_operations | A list of [revision_count, packs_to_combine]. |
packer_class | The class of packer to use | |
Returns | The new pack names. |
This cannot be used in the middle of a read-only transaction on the repository.
Parameters | existing_packs | The packs to pack. (A list of (revcount, Pack) tuples). |
pack_distribution | A list with the number of revisions desired in each pack. |
Returns | True if the disk names had not been previously read. |
Parameters | name | The name of the pack - e.g. '123456' |
Returns | A Pack object. |
Parameters | name | The name of the pack - e.g. '123456' |
Returns | A Pack object. |
Parameters | a_new_pack | A NewPack instance to be added to the collection of packs for this repository. |
This is used when loading the list from disk, and before writing to detect updates from others during our write operation. :return: An iterator of the index contents.
Parameters | total_revisions | The total number of revisions in the repository. |
Each pack and its associated indices are moved out of the way.
Note: for correctness this function should only be called after a new pack names index has been written without these pack names, and with the names of packs that contain the data previously available via these packs.
Parameters | packs | The packs to obsolete. |
return | None. |
Parameters | total_revisions | The total number of revisions in the repository. |
Only affects memory state, until self._save_pack_names() is invoked.
Parameters | ignore_missing | Suppress KeyErrors from calling remove_index. |
Returns | (disk_nodes, deleted_nodes, new_nodes) disk_nodes The final set of nodes that should be referenced deleted_nodes Nodes which have been removed from when we started new_nodes Nodes that are newly introduced |
Returns | (removed, added, modified) removed pack names removed from self._names added pack names added to self._names modified pack names that had changed value |
This will take out the mutex around the pack names list for the duration of the method call. If concurrent updates have been made, a three-way merge between the current list and the current in memory list is performed.
Parameters | clear_obsolete_packs | If True, clear out the contents of the obsolete_packs directory. |
obsolete_packs | Packs that are obsolete once the new pack-names file has been written. | |
Returns | A list of the names saved that were not previously on disk. |
This should be called when we find out that something we thought was present is now missing. This happens when another process re-packs the repository, etc.
Returns | True if the in-memory list of packs has been altered at all. |
Returns | A list of pack identifiers (the filename without '.pack') that were found in obsolete_packs. |