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.
../../../docs/code/draft_and_commit.py
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
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
../../../docs/code/draft_and_commit.py
After the commit, the draft will be closed.
../../../docs/code/draft_and_commit.py
../../../docs/code/draft_and_commit.py
../../../docs/code/draft_and_commit.py
../../../docs/code/draft_and_commit.py