class DictRefsContainer(RefsContainer):
Constructor: DictRefsContainer(refs, logger)
RefsContainer backed by a simple dict.
This container does not support symbolic or packed references and is not threadsafe.
| Method | __init__ |
Initialize DictRefsContainer with refs dictionary and optional logger. |
| Method | add |
Add a new reference only if it does not already exist. |
| Method | allkeys |
Return all reference keys. |
| Method | get |
Get packed references. |
| Method | get |
Get peeled version of a reference. |
| Method | read |
Read a loose reference. |
| Method | remove |
Remove a refname only if it currently equals old_ref. |
| Method | set |
Set a refname to new_ref only if it currently equals old_ref. |
| Method | set |
Make a ref point at another ref. |
| Method | _notify |
Undocumented |
| Method | _update |
Update multiple refs; intended only for testing. |
| Method | _update |
Update cached peeled refs; intended only for testing. |
| Instance Variable | _peeled |
Undocumented |
| Instance Variable | _refs |
Undocumented |
| Instance Variable | _watchers |
Undocumented |
Inherited from RefsContainer:
| Method | __contains__ |
Check if a reference exists. |
| Method | __delitem__ |
Remove a refname. |
| Method | __getitem__ |
Get the SHA1 for a reference name. |
| Method | __iter__ |
Iterate over all reference keys. |
| Method | __setitem__ |
Set a reference name to point to the given SHA1. |
| Method | add |
Add the given refs as packed refs. |
| Method | as |
Return the contents of this container as a dictionary. |
| Method | follow |
Follow a reference name. |
| Method | get |
Get a dict with all symrefs in this container. |
| Method | import |
Import refs from another repository. |
| Method | keys |
Refs present in this container. |
| Method | pack |
Pack loose refs into packed-refs file. |
| Method | read |
Read a reference without following any references. |
| Method | subkeys |
Refs present in this container under a base. |
| Method | _check |
Ensure a refname is valid and lives in refs or is HEAD. |
| Method | _log |
Undocumented |
| Instance Variable | _logger |
Undocumented |
dict[ Ref, bytes], logger: Callable[ [ bytes, (bytes | None), (bytes | None), (bytes | None), (int | None), (int | None), (bytes | None)], None] | None = None):
¶
dulwich.refs.RefsContainer.__init__Initialize DictRefsContainer with refs dictionary and optional logger.
Ref, ref: ObjectID, committer: bytes | None = None, timestamp: int | None = None, timezone: int | None = None, message: bytes | None = None) -> bool:
¶
dulwich.refs.RefsContainer.add_if_newAdd a new reference only if it does not already exist.
| Parameters | |
name:Ref | Ref name |
ref:ObjectID | Ref value |
committer:bytes | None | Optional committer name for reflog |
timestamp:int | None | Optional timestamp for reflog |
timezone:int | None | Optional timezone for reflog |
message:bytes | None | Optional message for reflog |
| Returns | |
bool | True if the add was successful, False otherwise. |
Ref, old_ref: ObjectID | None, committer: bytes | None = None, timestamp: int | None = None, timezone: int | None = None, message: bytes | None = None) -> bool:
¶
Remove a refname only if it currently equals old_ref.
This method does not follow symbolic references. It can be used to perform an atomic compare-and-delete operation.
| Parameters | |
name:Ref | The refname to delete. |
oldObjectID | None | The old sha the refname must refer to, or None to delete unconditionally. |
committer:bytes | None | Optional committer name for reflog |
timestamp:int | None | Optional timestamp for reflog |
timezone:int | None | Optional timezone for reflog |
message:bytes | None | Optional message for reflog |
| Returns | |
bool | True if the delete was successful, False otherwise. |
Ref, old_ref: ObjectID | None, new_ref: ObjectID, committer: bytes | None = None, timestamp: int | None = None, timezone: int | None = None, message: bytes | None = None) -> bool:
¶
dulwich.refs.RefsContainer.set_if_equalsSet a refname to new_ref only if it currently equals old_ref.
This method follows all symbolic references, and can be used to perform an atomic compare-and-swap operation.
| Parameters | |
name:Ref | The refname to set. |
oldObjectID | None | The old sha the refname must refer to, or None to set unconditionally. |
newObjectID | The new sha the refname will refer to. |
committer:bytes | None | Optional committer name for reflog |
timestamp:int | None | Optional timestamp for reflog |
timezone:int | None | Optional timezone for reflog |
message:bytes | None | Optional message for reflog |
| Returns | |
bool | True if the set was successful, False otherwise. |
Ref, other: Ref, committer: bytes | None = None, timestamp: int | None = None, timezone: int | None = None, message: bytes | None = None):
¶
Make a ref point at another ref.
| Parameters | |
name:Ref | Name of the ref to set |
other:Ref | Name of the ref to point at |
committer:bytes | None | Optional committer name for reflog |
timestamp:int | None | Optional timestamp for reflog |
timezone:int | None | Optional timezone for reflog |
message:bytes | None | Optional message for reflog |