graviti.manager.commit
#
The implementation of the Commit and CommitManager.
Module Contents#
Classes#
This class defines the structure of a commit. |
|
This class defines the structure of a named commit. |
|
This class defines the operations on the commit in Graviti. |
Attributes#
- class graviti.manager.commit.Commit(dataset, commit_id, parent_commit_id, title, description, committer, committed_at)[source]#
Bases:
graviti.manager.sheets.Sheets
,tensorbay.utility.AttrsMixin
This class defines the structure of a commit.
- Parameters
dataset (graviti.manager.dataset.Dataset) – Class
Dataset
instance.commit_id (str) – The commit id.
parent_commit_id (str) – The parent commit id.
title (str) – The commit title.
description (str) – The commit description.
committer (str) – The commit user.
committed_at (str) – The time when the draft is committed.
- class graviti.manager.commit.NamedCommit(dataset, name, commit_id, parent_commit_id, title, description, committer, committed_at)[source]#
Bases:
Commit
This class defines the structure of a named commit.
NamedCommit
is the base class ofBranch
andTag
.- Parameters
dataset (graviti.manager.dataset.Dataset) – Class
Dataset
instance.name (str) – The name of the named commit.
commit_id (str) – The commit id.
parent_commit_id (str) – The parent commit id.
title (str) – The commit title.
description (str) – The commit description.
committer (str) – The commit user.
committed_at (str) – The time when the draft is committed.
- to_pyobj(self)[source]#
Dump the instance to a python dict.
- Returns
A python dict containing all the information of the named commit:
{ "name": <str> "commit_id": <str> "parent_commit_id": <str> "title": <str> "description": <str> "committer": <str> "committed_at": <str> }
- Return type
Dict[str, str]
- class graviti.manager.commit.CommitManager(dataset)[source]#
This class defines the operations on the commit in Graviti.
- Parameters
dataset (graviti.manager.dataset.Dataset) –
Dataset
instance.
- list(self, revision=None)[source]#
List the commits.
- Parameters
revision (Optional[str]) – The information to locate the specific commit, which can be the commit id, the branch name, or the tag name. If it is given, list the commits before the given commit. If it is not given, list the commits before the current commit.
- Returns
The LazyPagingList of
commits
instances.- Return type