Skip to content

Commit

Permalink
docs: update version control chapter based on newly added Branch section
Browse files Browse the repository at this point in the history
1. remove "linear version control" description in version_control.rst
2. modify content about creating draft in draft_and_commit.rst
3. modify content about branch and draft in glossary.rst

PR Closed: #670
  • Loading branch information
rexzheng324-c committed Jun 7, 2021
1 parent bd92d9f commit 4ffdb65
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/code/draft_and_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
# is_draft = True (True for draft, False for commit)
draft_number = dataset_client.status.draft_number
# draft_number = 1
branch_name = dataset_client.status.branch_name
# branch_name = main
""""""

"""Create Draft on a Branch"""
dataset_client.create_draft("draft-1", branch_name="main")
""""""

"""List Drafts"""
Expand Down
2 changes: 1 addition & 1 deletion docs/source/features/version_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Version Control
#################

TensorBay currently supports the linear version control.
TensorBay supports version control.
A new version of a dataset can be built upon the previous version.
:numref:`Figure. %s <version_control>` demonstrates the relations
between different versions of a dataset.
Expand Down
4 changes: 1 addition & 3 deletions docs/source/reference/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ branch

Similar to git, a branch is a lightweight pointer to one of the commits.

Currently, TensorBay only supports a single branch, which is the default "main" branch.

Every time a :ref:`reference/glossary:commit` is submitted,
the main branch pointer moves forward automatically to the latest commit.

Expand Down Expand Up @@ -130,7 +128,7 @@ draft

Similar with Git, a draft is a workspace in which changing the dataset is allowed.

A draft is created based on a :ref:`reference/glossary:commit`,
A draft is created based on a :ref:`reference/glossary:branch`,
and the changes inside it will be made into a commit.

There are scenarios when modifications of a dataset are required,
Expand Down
10 changes: 9 additions & 1 deletion docs/source/version_control/draft_and_commit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Authorization
Create Draft
*************

TensorBay SDK supports creating the draft straightforwardly, which is based on the current commit.
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.

.. literalinclude:: ../../../docs/code/draft_and_commit.py
:language: python
Expand All @@ -40,6 +41,13 @@ The draft number will be auto-increasing every time a draft is created.
:start-after: """Draft Number Will Be Stored"""
:end-before: """"""

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

.. literalinclude:: ../../../docs/code/draft_and_commit.py
:language: python
:start-after: """Create Draft on a Branch"""
:end-before: """"""

************
List Drafts
************
Expand Down

0 comments on commit 4ffdb65

Please sign in to comment.