@@ -1852,11 +1852,6 @@ class ProjectSnippet(GitlabObject):
1852
1852
[('project_id' , 'project_id' ), ('snippet_id' , 'id' )]),
1853
1853
)
1854
1854
1855
- def Content (self , ** kwargs ):
1856
- warnings .warn ("`Content` is deprecated, use `content` instead" ,
1857
- DeprecationWarning )
1858
- return self .content ()
1859
-
1860
1855
def content (self , streamed = False , action = None , chunk_size = 1024 , ** kwargs ):
1861
1856
"""Return the raw content of a snippet.
1862
1857
@@ -2082,11 +2077,6 @@ class Project(GitlabObject):
2082
2077
VISIBILITY_INTERNAL = gitlab .VISIBILITY_INTERNAL
2083
2078
VISIBILITY_PUBLIC = gitlab .VISIBILITY_PUBLIC
2084
2079
2085
- def tree (self , path = '' , ref_name = '' , ** kwargs ):
2086
- warnings .warn ("`tree` is deprecated, use `repository_tree` instead" ,
2087
- DeprecationWarning )
2088
- return self .repository_tree (path , ref_name , ** kwargs )
2089
-
2090
2080
def repository_tree (self , path = '' , ref_name = '' , ** kwargs ):
2091
2081
"""Return a list of files in the repository.
2092
2082
@@ -2113,11 +2103,6 @@ def repository_tree(self, path='', ref_name='', **kwargs):
2113
2103
raise_error_from_response (r , GitlabGetError )
2114
2104
return r .json ()
2115
2105
2116
- def blob (self , sha , filepath , ** kwargs ):
2117
- warnings .warn ("`blob` is deprecated, use `repository_blob` instead" ,
2118
- DeprecationWarning )
2119
- return self .repository_blob (sha , filepath , ** kwargs )
2120
-
2121
2106
def repository_blob (self , sha , filepath , streamed = False , action = None ,
2122
2107
chunk_size = 1024 , ** kwargs ):
2123
2108
"""Return the content of a file for a commit.
@@ -2205,12 +2190,6 @@ def repository_contributors(self):
2205
2190
raise_error_from_response (r , GitlabListError )
2206
2191
return r .json ()
2207
2192
2208
- def archive (self , sha = None , ** kwargs ):
2209
- warnings .warn ("`archive` is deprecated, "
2210
- "use `repository_archive` instead" ,
2211
- DeprecationWarning )
2212
- return self .repository_archive (sha , ** kwargs )
2213
-
2214
2193
def repository_archive (self , sha = None , streamed = False , action = None ,
2215
2194
chunk_size = 1024 , ** kwargs ):
2216
2195
"""Return a tarball of the repository.
@@ -2238,49 +2217,6 @@ def repository_archive(self, sha=None, streamed=False, action=None,
2238
2217
raise_error_from_response (r , GitlabGetError )
2239
2218
return utils .response_content (r , streamed , action , chunk_size )
2240
2219
2241
- def create_file (self , path , branch , content , message , ** kwargs ):
2242
- """Creates file in project repository
2243
-
2244
- Args:
2245
- path (str): Full path to new file.
2246
- branch (str): The name of branch.
2247
- content (str): Content of the file.
2248
- message (str): Commit message.
2249
- **kwargs: Arbitrary keyword arguments.
2250
-
2251
- Raises:
2252
- GitlabConnectionError: If the server cannot be reached.
2253
- GitlabCreateError: If the server fails to perform the request.
2254
- """
2255
- warnings .warn ("`create_file` is deprecated, "
2256
- "use `files.create()` instead" ,
2257
- DeprecationWarning )
2258
- url = "/projects/%s/repository/files" % self .id
2259
- url += ("?file_path=%s&branch_name=%s&content=%s&commit_message=%s" %
2260
- (path , branch , content , message ))
2261
- r = self .gitlab ._raw_post (url , data = None , content_type = None , ** kwargs )
2262
- raise_error_from_response (r , GitlabCreateError , 201 )
2263
-
2264
- def update_file (self , path , branch , content , message , ** kwargs ):
2265
- warnings .warn ("`update_file` is deprecated, "
2266
- "use `files.update()` instead" ,
2267
- DeprecationWarning )
2268
- url = "/projects/%s/repository/files" % self .id
2269
- url += ("?file_path=%s&branch_name=%s&content=%s&commit_message=%s" %
2270
- (path , branch , content , message ))
2271
- r = self .gitlab ._raw_put (url , data = None , content_type = None , ** kwargs )
2272
- raise_error_from_response (r , GitlabUpdateError )
2273
-
2274
- def delete_file (self , path , branch , message , ** kwargs ):
2275
- warnings .warn ("`delete_file` is deprecated, "
2276
- "use `files.delete()` instead" ,
2277
- DeprecationWarning )
2278
- url = "/projects/%s/repository/files" % self .id
2279
- url += ("?file_path=%s&branch_name=%s&commit_message=%s" %
2280
- (path , branch , message ))
2281
- r = self .gitlab ._raw_delete (url , ** kwargs )
2282
- raise_error_from_response (r , GitlabDeleteError )
2283
-
2284
2220
def create_fork_relation (self , forked_from_id ):
2285
2221
"""Create a forked from/to relation between existing projects.
2286
2222
@@ -2336,7 +2272,7 @@ def unstar(self, **kwargs):
2336
2272
raise_error_from_response (r , GitlabDeleteError , [200 , 304 ])
2337
2273
return Project (self .gitlab , r .json ()) if r .status_code == 200 else self
2338
2274
2339
- def archive_ (self , ** kwargs ):
2275
+ def archive (self , ** kwargs ):
2340
2276
"""Archive a project.
2341
2277
2342
2278
Returns:
@@ -2351,7 +2287,12 @@ def archive_(self, **kwargs):
2351
2287
raise_error_from_response (r , GitlabCreateError , 201 )
2352
2288
return Project (self .gitlab , r .json ()) if r .status_code == 201 else self
2353
2289
2354
- def unarchive_ (self , ** kwargs ):
2290
+ def archive_ (self , ** kwargs ):
2291
+ warnings .warn ("`archive_()` is deprecated, use `archive()` instead" ,
2292
+ DeprecationWarning )
2293
+ return self .archive (** kwargs )
2294
+
2295
+ def unarchive (self , ** kwargs ):
2355
2296
"""Unarchive a project.
2356
2297
2357
2298
Returns:
@@ -2366,6 +2307,12 @@ def unarchive_(self, **kwargs):
2366
2307
raise_error_from_response (r , GitlabCreateError , 201 )
2367
2308
return Project (self .gitlab , r .json ()) if r .status_code == 201 else self
2368
2309
2310
+ def unarchive_ (self , ** kwargs ):
2311
+ warnings .warn ("`unarchive_()` is deprecated, "
2312
+ "use `unarchive()` instead" ,
2313
+ DeprecationWarning )
2314
+ return self .unarchive (** kwargs )
2315
+
2369
2316
def share (self , group_id , group_access , ** kwargs ):
2370
2317
"""Share the project with a group.
2371
2318
0 commit comments