summaryrefslogtreecommitdiff
path: root/docs/gl_objects/projects.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/gl_objects/projects.py')
-rw-r--r--docs/gl_objects/projects.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py
index 6898282..6a7cb6d 100644
--- a/docs/gl_objects/projects.py
+++ b/docs/gl_objects/projects.py
@@ -150,3 +150,47 @@ project.hooks.delete(1)
# or
hook.delete()
# end hook delete
+
+# repository tree
+# list the content of the root directory for the default branch
+items = project.repository_tree()
+
+# list the content of a subdirectory on a specific branch
+items = project.repository_tree(path='docs', ref='branch1')
+# end repository tree
+
+# repository blob
+file_content = p.repository_blob('master', 'README.rst')
+# end repository blob
+
+# repository raw_blob
+# find the id for the blob (simple search)
+id = [d['id'] for d in p.repository_tree() if d['name'] == 'README.rst'][0]
+
+# get the content
+file_content = p.repository_raw_blob(id)
+# end repository raw_blob
+
+# repository compare
+result = project.repository_compare('master', 'branch1')
+
+# get the commits
+for i in commit:
+ print(result.commits)
+
+# get the diffs
+for file_diff in commit.diffs:
+ print(file_diff)
+# end repository compare
+
+# repository archive
+# get the archive for the default branch
+tgz = project.repository_archive()
+
+# get the archive for a branch/tag/commit
+tgz = project.repository_archive(sha='4567abc')
+# end repository archive
+
+# repository contributors
+contributors = project.repository_contributors()
+# end repository contributors