module documentation
Object specification.
| Exception | |
The short id is ambiguous. |
| Function | parse |
Parse a string referring to a single commit. |
| Function | parse |
Parse a string referring to a commit range. |
| Function | parse |
Parse a string referring to an object. |
| Function | parse |
Parse a string referring to a reference. |
| Function | parse |
Parse a list of refspecs to a list of refs. |
| Function | parse |
Parse a reftuple spec. |
| Function | parse |
Parse a list of reftuple specs to a list of reftuples. |
| Function | parse |
Parse a string referring to a tree. |
| Function | scan |
Scan an object store for a short id. |
| Function | to |
Convert text to bytes. |
| Function | _parse |
Parse a number from the start of suffix, return (number, remaining). |
| Function | _resolve |
Resolve a reference to an object using multiple strategies. |
Parse a string referring to a single commit.
Returns: A Commit object
| Parameters | |
repo:BaseRepo | A repository object |
committish:str | bytes | Commit | Tag | A string referring to a single commit, or a Commit or Tag object. |
| Returns | |
Commit | Undocumented |
| Raises | |
KeyError | When the reference commits can not be found |
ValueError | If the range can not be parsed |
Parse a string referring to a commit range.
| Parameters | |
repo:Repo | A Repo object |
committish:str | bytes | A string referring to a commit or range (e.g., "HEAD~3..HEAD") |
| Returns | |
tuple[ | None if committish is a single commit reference A tuple of (start_commit, end_commit) if it's a range |
| Raises | |
KeyError | When the commits can not be found |
ValueError | If the range can not be parsed |
def parse_reftuple(lh_container:
Repo | RefsContainer, rh_container: Repo | RefsContainer, refspec: str | bytes, force: bool = False) -> tuple[ Ref | None, Ref | None, bool]:
¶
Parse a reftuple spec.
Returns: A tuple with left and right ref
| Parameters | |
lhRepo | RefsContainer | A RefsContainer object |
rhRepo | RefsContainer | A RefsContainer object |
refspec:str | bytes | A string |
force:bool | Whether to force the operation |
| Returns | |
tuple[ | Undocumented |
| Raises | |
KeyError | If one of the refs can not be found |
def parse_reftuples(lh_container:
Repo | RefsContainer, rh_container: Repo | RefsContainer, refspecs: bytes | Sequence[ bytes], force: bool = False) -> list[ tuple[ Ref | None, Ref | None, bool]]:
¶
Parse a list of reftuple specs to a list of reftuples.
Returns: A list of refs
| Parameters | |
lhRepo | RefsContainer | A RefsContainer object |
rhRepo | RefsContainer | A RefsContainer object |
refspecs:bytes | Sequence[ | A list of refspecs or a string |
force:bool | Force overwriting for all reftuples |
| Returns | |
list[ | Undocumented |
| Raises | |
KeyError | If one of the refs can not be found |
def scan_for_short_id(object_store:
BaseObjectStore, prefix: bytes, tp: type[ ShaFile]) -> ShaFile:
¶
Scan an object store for a short id.