diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-08-25 15:46:13 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-08-25 15:46:13 +0200 |
commit | 4d4c8ad1f75142fa1ca6ccd037e9d501ca873b60 (patch) | |
tree | 1880927204835b58f964c545beeab8defa6f6eb6 | |
parent | a221d7b35bc20da758e7467fe789e16613c54275 (diff) | |
download | gitlab-4d4c8ad1f75142fa1ca6ccd037e9d501ca873b60.tar.gz |
Add a FAQ
-rw-r--r-- | docs/faq.rst | 33 | ||||
-rw-r--r-- | docs/index.rst | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/docs/faq.rst b/docs/faq.rst new file mode 100644 index 0000000..fe71198 --- /dev/null +++ b/docs/faq.rst @@ -0,0 +1,33 @@ +### +FAQ +### + +I cannot edit the merge request / issue I've just retrieved + It is likely that you used a ``MergeRequest``, ``GroupMergeRequest``, + ``Issue`` or ``GroupIssue`` object. These objects cannot be edited. But you + can create a new ``ProjectMergeRequest`` or ``ProjectIssue`` object to + apply changes. For example:: + + issue = gl.issues.list()[0] + project = gl.projects.get(issue.project_id, lazy=True) + editable_issue = project.issues.get(issue.iid, lazy=True) + # you can now edit the object + + See the :ref:`merge requests example <merge_requests_examples>` and the + :ref:`issues examples <issues_examples>`. + +How can I clone the repository of a project? + python-gitlab doesn't provide an API to clone a project. You have to use a + git library or call the ``git`` command. + + The git URI is exposed in the ``ssh_url_to_repo`` attribute of ``Project`` + objects. + + Example:: + + import subprocess + + project = gl.projects.create(data) # or gl.projects.get(project_id) + print(project.attributes) # displays all the attributes + git_url = project.ssh_url_to_repo + subprocess.call(['git', 'clone', git_url]) diff --git a/docs/index.rst b/docs/index.rst index 7805fcf..9c8cfd3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,6 +14,7 @@ Contents: install cli api-usage + faq switching-to-v4 api-objects api/gitlab |