class documentation

Git Client that reads from a bundle file.

Class Method from_parsedurl Create an instance of BundleClient from a parsed URL.
Method __init__ Create a new BundleClient instance.
Method fetch Fetch into a target repository from a bundle file.
Method fetch_pack Retrieve a pack from a bundle file.
Method get_refs Retrieve the current refs from a bundle file.
Method get_url Get the URL for a bundle file path.
Method send_pack Upload is not supported for bundle files.
Class Method _is_bundle_file Check if a file is a git bundle by reading the first line.
Class Method _open_bundle Open and parse a bundle file.
Static Method _skip_to_pack_data Skip to the pack data section in a bundle file.
Instance Variable _include_tags Undocumented
Instance Variable _quiet Undocumented
Instance Variable _report_activity Undocumented

Inherited from GitClient:

Method archive Retrieve an archive of the specified tree.
Method clone Clone a repository.
Method close Close the client and release any resources.
Method fetch_with_bundle_uri Fetch into a target repository, using bundle URIs for bootstrap.
Instance Variable protocol_version Undocumented
Static Method _should_send_pack Undocumented
Static Method _warn_filter_objects Undocumented
Method _handle_receive_pack_tail Handle the tail of a 'git-receive-pack' request.
Method _negotiate_receive_pack_capabilities Undocumented
Method _negotiate_upload_pack_capabilities Undocumented
Instance Variable _fetch_capabilities Undocumented
Instance Variable _report_status_parser Undocumented
Instance Variable _send_capabilities Undocumented
def from_parsedurl(cls, parsedurl: ParseResult, thin_packs: bool = True, report_activity: Callable[[int, str], None] | None = None, quiet: bool = False, include_tags: bool = False, dumb: bool = False, username: str | None = None, password: str | None = None, config: Config | None = None) -> BundleClient:

Create an instance of BundleClient from a parsed URL.

Parameters
parsedurl:ParseResultResult of urlparse()
thin_packs:boolWhether or not thin packs should be retrieved
report_activity:Callable[[int, str], None] | NoneOptional callback for reporting transport activity
quiet:boolWhether to suppress progress output
include_tags:boolWhether to include tags
dumb:boolWhether to use dumb protocol (not used for BundleClient)
username:str | NoneUsername for authentication (not used for BundleClient)
password:str | NonePassword for authentication (not used for BundleClient)
config:Config | NoneConfiguration object (not used for BundleClient)
Returns
BundleClientA BundleClient instance
def __init__(self, thin_packs: bool = True, report_activity: Callable[[int, str], None] | None = None, config: Config | None = None, quiet: bool = False, include_tags: bool = False):

Create a new BundleClient instance.

Parameters
thin_packs:boolWhether or not thin packs should be retrieved
report_activity:Callable[[int, str], None] | NoneOptional callback for reporting transport activity.
config:Config | NoneOptional configuration object
quiet:boolWhether to suppress progress output
include_tags:boolWhether to include tags
def fetch(self, path: bytes | str, target: BaseRepo, determine_wants: DetermineWantsFunc | None = None, progress: Callable[[bytes], None] | None = None, depth: int | None = None, ref_prefix: Sequence[bytes] | None = None, filter_spec: bytes | None = None, protocol_version: int | None = None, shallow_since: str | None = None, shallow_exclude: list[str] | None = None) -> FetchPackResult:

Fetch into a target repository from a bundle file.

def fetch_pack(self, path: str | bytes, determine_wants: DetermineWantsFunc, graph_walker: GraphWalker, pack_data: Callable[[bytes], int], progress: Callable[[bytes], None] | None = None, depth: int | None = None, ref_prefix: Sequence[bytes] | None = None, filter_spec: bytes | None = None, protocol_version: int | None = None, shallow_since: str | None = None, shallow_exclude: list[str] | None = None) -> FetchPackResult:

Retrieve a pack from a bundle file.

def get_refs(self, path: str | bytes, protocol_version: int | None = None, ref_prefix: Sequence[bytes] | None = None) -> LsRemoteResult:

Retrieve the current refs from a bundle file.

def get_url(self, path: str) -> str:

Get the URL for a bundle file path.

Parameters
path:strBundle file path
Returns
strThe path unchanged (bundle files use local paths)
def send_pack(self, path: str | bytes, update_refs: Callable[[dict[Ref, ObjectID]], dict[Ref, ObjectID]], generate_pack_data: GeneratePackDataFunc, progress: Callable[[bytes], None] | None = None, push_options: Sequence[bytes] | None = None, atomic: bool = False) -> SendPackResult:

Upload is not supported for bundle files.

def _is_bundle_file(cls, path: str) -> bool:

Check if a file is a git bundle by reading the first line.

def _open_bundle(cls, path: str | bytes) -> Bundle:

Open and parse a bundle file.

Parameters
path:str | bytesPath to the bundle file (bytes or str)
Returns
BundleBundle object with parsed metadata
Raises
AssertionErrorIf bundle format is unsupported
def _skip_to_pack_data(f: IO[bytes], version: int):

Skip to the pack data section in a bundle file.

Parameters
f:IO[bytes]File object positioned at the beginning of the bundle
version:intBundle format version (2 or 3)
Raises
AssertionErrorIf bundle header is invalid
_include_tags =

Undocumented

_quiet =

Undocumented

_report_activity =