class documentation

class BitmapReachability:

Constructor: BitmapReachability(object_store)

View In Hierarchy

Bitmap-accelerated implementation of ObjectReachabilityProvider.

This implementation uses packfile bitmap indexes where available to accelerate reachability queries. Falls back to graph traversal when bitmaps don't cover the requested commits.

Method __init__ Initialize the bitmap provider.
Method get_reachable_commits Get all commits reachable from heads using bitmaps where possible.
Method get_reachable_objects Get all objects reachable from commits using bitmaps.
Method get_tree_objects Get all trees and blobs reachable from the given trees.
Instance Variable store Undocumented
Method _combine_commit_bitmaps Combine bitmaps for multiple commits using OR, with optional exclusion.
Instance Variable _fallback Undocumented
def __init__(self, object_store: PackBasedObjectStore):

Initialize the bitmap provider.

Parameters
object_store:PackBasedObjectStorePack-based object store with bitmap support
def get_reachable_commits(self, heads: Iterable[ObjectID], exclude: Iterable[ObjectID] | None = None, shallow: Set[ObjectID] | None = None) -> set[ObjectID]:

Get all commits reachable from heads using bitmaps where possible.

Parameters
heads:Iterable[ObjectID]Starting commit SHAs
exclude:Iterable[ObjectID] | NoneCommit SHAs to exclude (and their ancestors)
shallow:Set[ObjectID] | NoneSet of shallow commit boundaries
Returns
set[ObjectID]Set of commit SHAs reachable from heads but not from exclude
def get_reachable_objects(self, commits: Iterable[ObjectID], exclude_commits: Iterable[ObjectID] | None = None) -> set[ObjectID]:

Get all objects reachable from commits using bitmaps.

Parameters
commits:Iterable[ObjectID]Starting commit SHAs
exclude_commits:Iterable[ObjectID] | NoneCommits whose objects should be excluded
Returns
set[ObjectID]Set of all object SHAs (commits, trees, blobs)
def get_tree_objects(self, tree_shas: Iterable[ObjectID]) -> set[ObjectID]:

Get all trees and blobs reachable from the given trees.

Parameters
tree_shas:Iterable[ObjectID]Starting tree SHAs
Returns
set[ObjectID]Set of tree and blob SHAs
store =

Undocumented

def _combine_commit_bitmaps(self, commit_shas: set[ObjectID], exclude_shas: set[ObjectID] | None = None) -> tuple[EWAHBitmap, Pack] | None:

Combine bitmaps for multiple commits using OR, with optional exclusion.

Parameters
commit_shas:set[ObjectID]Set of commit SHAs to combine
exclude_shas:set[ObjectID] | NoneOptional set of commit SHAs to exclude
Returns
tuple[EWAHBitmap, Pack] | NoneTuple of (combined_bitmap, pack) or None if bitmaps unavailable
_fallback =

Undocumented