versioned_collection.collection.tracking_collections.metadata module

class versioned_collection.collection.tracking_collections.metadata.MetadataCollection(*args: Any, **kwargs: Any)[source]

Bases: _BaseTrackerCollection

Stores metadata about the current state of the target collection.

This collection keeps track of the current version of the target versioned collection, i.e., its version and branch, and information about the ‘head’ branch pointer, which specifies whether unregistered changes were made since the last registered version of the collection and whether the head pointer is detached, i.e., we are not checked out to a branch ( or more specifically, to the latest registered version on a branch).

class SCHEMA(current_version: int, current_branch: str, detached: bool, changed: bool, has_stash: bool, has_conflicts: bool)[source]

Bases: object

changed: bool
current_branch: str
current_version: int
detached: bool
has_conflicts: bool
has_stash: bool
build() bool[source]

Build this collection on the database.

Returns:

True if the collection was successfully built, False otherwise.

property metadata: SCHEMA
set_metadata(current_version: int | None = None, current_branch: str | None = None, detached: bool | None = None, changed: bool | None = None, has_stash: bool | None = None, has_conflicts: bool | None = None) None[source]

Set some or all of the metadata attributes.