@@ -1448,6 +1448,11 @@ def Tag(self, id=None, **kwargs):
14481448 ** kwargs )
14491449
14501450 def tree (self , path = '' , ref_name = '' , ** kwargs ):
1451+ warnings .warn ("`tree` is deprecated, use `repository_tree` instead" ,
1452+ DeprecationWarning )
1453+ return self .repository_tree (path , ref_name , ** kwargs )
1454+
1455+ def repository_tree (self , path = '' , ref_name = '' , ** kwargs ):
14511456 """Return a list of files in the repository.
14521457
14531458 Args:
@@ -1474,6 +1479,11 @@ def tree(self, path='', ref_name='', **kwargs):
14741479 return r .json ()
14751480
14761481 def blob (self , sha , filepath , ** kwargs ):
1482+ warnings .warn ("`blob` is deprecated, use `repository_blob` instead" ,
1483+ DeprecationWarning )
1484+ return self .repository_blob (sha , filepath , ** kwargs )
1485+
1486+ def repository_blob (self , sha , filepath , ** kwargs ):
14771487 """Return the content of a file for a commit.
14781488
14791489 Args:
@@ -1493,7 +1503,7 @@ def blob(self, sha, filepath, **kwargs):
14931503 raise_error_from_response (r , GitlabGetError )
14941504 return r .content
14951505
1496- def raw_blob (self , sha , ** kwargs ):
1506+ def repository_raw_blob (self , sha , ** kwargs ):
14971507 """Returns the raw file contents for a blob by blob SHA.
14981508
14991509 Args:
@@ -1511,7 +1521,7 @@ def raw_blob(self, sha, **kwargs):
15111521 raise_error_from_response (r , GitlabGetError )
15121522 return r .content
15131523
1514- def compare (self , from_ , to , ** kwargs ):
1524+ def repository_compare (self , from_ , to , ** kwargs ):
15151525 """Returns a diff between two branches/commits.
15161526
15171527 Args:
@@ -1531,7 +1541,7 @@ def compare(self, from_, to, **kwargs):
15311541 raise_error_from_response (r , GitlabGetError )
15321542 return r .json ()
15331543
1534- def contributors (self ):
1544+ def repository_contributors (self ):
15351545 """Returns a list of contributors for the project.
15361546
15371547 Returns:
@@ -1580,20 +1590,29 @@ def create_file(self, path, branch, content, message, **kwargs):
15801590 GitlabConnectionError: If the server cannot be reached.
15811591 GitlabCreateError: If the server fails to perform the request.
15821592 """
1593+ warnings .warn ("`create_file` is deprecated, "
1594+ "use `files.create()` instead" ,
1595+ DeprecationWarning )
15831596 url = "/projects/%s/repository/files" % self .id
15841597 url += ("?file_path=%s&branch_name=%s&content=%s&commit_message=%s" %
15851598 (path , branch , content , message ))
15861599 r = self .gitlab ._raw_post (url , data = None , content_type = None , ** kwargs )
15871600 raise_error_from_response (r , GitlabCreateError , 201 )
15881601
15891602 def update_file (self , path , branch , content , message , ** kwargs ):
1603+ warnings .warn ("`update_file` is deprecated, "
1604+ "use `files.update()` instead" ,
1605+ DeprecationWarning )
15901606 url = "/projects/%s/repository/files" % self .id
15911607 url += ("?file_path=%s&branch_name=%s&content=%s&commit_message=%s" %
15921608 (path , branch , content , message ))
15931609 r = self .gitlab ._raw_put (url , data = None , content_type = None , ** kwargs )
15941610 raise_error_from_response (r , GitlabUpdateError )
15951611
15961612 def delete_file (self , path , branch , message , ** kwargs ):
1613+ warnings .warn ("`delete_file` is deprecated, "
1614+ "use `files.delete()` instead" ,
1615+ DeprecationWarning )
15971616 url = "/projects/%s/repository/files" % self .id
15981617 url += ("?file_path=%s&branch_name=%s&commit_message=%s" %
15991618 (path , branch , message ))
0 commit comments