summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-05-13 18:36:30 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2016-05-13 18:36:30 +0200
commit24c283f5861f21e51489afc815bd9f31bff58bee (patch)
tree00bddcdb84fa14564400065a3862fd7fe6a2b062
parent45adb6e4dbe7667376639d68078754d6d72cb55c (diff)
downloadgitlab-24c283f5861f21e51489afc815bd9f31bff58bee.tar.gz
Deprecate Project.archive()
-rw-r--r--gitlab/objects.py7
-rw-r--r--tools/python_test.py4
2 files changed, 9 insertions, 2 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 6aa44d1..94bf1d9 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -1556,7 +1556,14 @@ class Project(GitlabObject):
raise_error_from_response(r, GitlabListError)
return r.json()
+
def archive(self, sha=None, **kwargs):
+ warnings.warn("`archive` is deprecated, "
+ "use `repository_archive` instead",
+ DeprecationWarning)
+ return self.repository_archive(path, ref_name, **kwargs)
+
+ def repository_archive(self, sha=None, **kwargs):
"""Return a tarball of the repository.
Args:
diff --git a/tools/python_test.py b/tools/python_test.py
index df8de23..d071435 100644
--- a/tools/python_test.py
+++ b/tools/python_test.py
@@ -152,8 +152,8 @@ assert(len(tree) == 1)
assert(tree[0]['name'] == 'README.rst')
blob = admin_project.repository_blob('master', 'README.rst')
assert(blob == 'Initial content')
-archive1 = admin_project.archive()
-archive2 = admin_project.archive('master')
+archive1 = admin_project.repository_archive()
+archive2 = admin_project.repository_archive('master')
assert(archive1 == archive2)
# labels