summaryrefslogtreecommitdiff
path: root/docs/gl_objects/branches.rst
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-08-11 16:07:04 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2017-08-11 16:07:04 +0200
commit4057644f03829e4439ec8ab1feacf90c65d976eb (patch)
tree977658ba5109c8a3b512a882bf0a037daad754cb /docs/gl_objects/branches.rst
parent80eab7b0c0682c5df99495acc4d6f71f36603cfc (diff)
downloadgitlab-4057644f03829e4439ec8ab1feacf90c65d976eb.tar.gz
Update the objects doc/examples for v4
Diffstat (limited to 'docs/gl_objects/branches.rst')
-rw-r--r--docs/gl_objects/branches.rst37
1 files changed, 25 insertions, 12 deletions
diff --git a/docs/gl_objects/branches.rst b/docs/gl_objects/branches.rst
index 50b97a7..279ca0c 100644
--- a/docs/gl_objects/branches.rst
+++ b/docs/gl_objects/branches.rst
@@ -2,15 +2,25 @@
Branches
########
-Use :class:`~gitlab.objects.ProjectBranch` objects to manipulate repository
-branches.
+References
+----------
-To create :class:`~gitlab.objects.ProjectBranch` objects use the
-:attr:`gitlab.Gitlab.project_branches` or :attr:`Project.branches
-<gitlab.objects.Project.branches>` managers.
+* v4 API:
+
+ + :class:`gitlab.v4.objects.ProjectBranch`
+ + :class:`gitlab.v4.objects.ProjectBranchManager`
+ + :attr:`gitlab.v4.objects.Project.branches`
+
+* v3 API:
+
+ + :class:`gitlab.v3.objects.ProjectBranch`
+ + :class:`gitlab.v3.objects.ProjectBranchManager`
+ + :attr:`gitlab.v3.objects.Project.branches`
+
+* GitLab API: https://docs.gitlab.com/ce/api/branches.html
Examples
-========
+--------
Get the list of branches for a repository:
@@ -41,10 +51,13 @@ Protect/unprotect a repository branch:
.. literalinclude:: branches.py
:start-after: # protect
:end-before: # end protect
-
+
.. note::
-
- By default, developers will not be able to push or merge into
- protected branches. This can be changed by passing ``developers_can_push``
- or ``developers_can_merge`` like so:
- ``branch.protect(developers_can_push=False, developers_can_merge=True)``
+
+ By default, developers are not authorized to push or merge into protected
+ branches. This can be changed by passing ``developers_can_push`` or
+ ``developers_can_merge``:
+
+ .. code-block:: python
+
+ branch.protect(developers_can_push=True, developers_can_merge=True)