Skip to content

Latest commit

 

History

History
110 lines (82 loc) · 2.96 KB

draft_and_commit.rst

File metadata and controls

110 lines (82 loc) · 2.96 KB

Draft and Commit

The version control is based on the reference/glossary:draft and reference/glossary:commit.

Similar with Git, a reference/glossary:commit is a version of a dataset, which contains the changes compared with the former commit.

Unlike Git, a reference/glossary:draft is a new concept which represents a workspace in which changing the dataset is allowed.

In TensorBay SDK, the dataset client supplies the function of version control.

Authorization

../../../docs/code/draft_and_commit.py

Create Draft

TensorBay SDK supports creating the draft straightforwardly, which is based on the current branch. Note that currently there can be only one open draft in each branch.

../../../docs/code/draft_and_commit.py

Then the dataset client will change the status to "draft" and store the draft number. The draft number will be auto-increasing every time a draft is created.

../../../docs/code/draft_and_commit.py

Also, TensorBay SDK supports creating a draft based on a given branch.

../../../docs/code/draft_and_commit.py

List Drafts

The draft number can be found through listing drafts.

status includes "OPEN", "CLOSED", "COMMITTED" and None where None means listing drafts in all status. branch_name refers to the branch name of the draft to be listed.

../../../docs/code/draft_and_commit.py

Get Draft

../../../docs/code/draft_and_commit.py

Commit Draft

After the commit, the draft will be closed.

../../../docs/code/draft_and_commit.py

Get Commit

../../../docs/code/draft_and_commit.py

List Commits

../../../docs/code/draft_and_commit.py

Checkout

../../../docs/code/draft_and_commit.py