class documentation
Lock a ref while making modifications.
Works as a context manager.
| Method | __enter__ |
Enter the context manager and acquire the lock. |
| Method | __exit__ |
Exit the context manager and release the lock. |
| Method | __init__ |
Initialize a locked ref. |
| Method | delete |
Delete the ref file while holding the lock. |
| Method | ensure |
Ensure the ref currently equals the expected value. |
| Method | get |
Get the current value of the ref. |
| Method | set |
Set the ref to a new value. |
| Method | set |
Make this ref point at another ref. |
| Instance Variable | _deleted |
Undocumented |
| Instance Variable | _file |
Undocumented |
| Instance Variable | _realname |
Undocumented |
| Instance Variable | _refname |
Undocumented |
| Instance Variable | _refs |
Undocumented |
Enter the context manager and acquire the lock.
| Returns | |
locked_ref | This locked_ref instance |
| Raises | |
OSError | If the lock cannot be acquired |
def __exit__(self, exc_type:
type | None, exc_value: BaseException | None, traceback: types.TracebackType | None):
¶
Exit the context manager and release the lock.
| Parameters | |
exctype | None | Type of exception if one occurred |
excBaseException | None | Exception instance if one occurred |
traceback:types.TracebackType | None | Traceback if an exception occurred |
Initialize a locked ref.
| Parameters | |
refsDiskRefsContainer | The DiskRefsContainer to lock the ref in |
refname:Ref | The ref name to lock |