Changeset - 34d009e5147a
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 14 years ago 2012-02-19 19:50:00
marcin@python-works.com
added clone_uri to API method for creating users
3 files changed with 9 insertions and 7 deletions:
0 comments (0 inline, 0 general)
docs/api/api.rst
Show inline comments
 
@@ -488,13 +488,14 @@ INPUT::
 
    method :  "create_repo"
 
    args:     {
 
                "repo_name" :   "<reponame>",
 
                "owner_name" :  "<ownername>",
 
                "description" : "<description> = ''",
 
                "repo_type" :   "<type> = 'hg'",
 
                "private" :     "<bool> = False"
 
                "private" :     "<bool> = False",
 
                "clone_uri" :   "<clone_uri> = None",
 
              }
 

	
 
OUTPUT::
 

	
 
    result: {
 
              "id": "<newrepoid>",
rhodecode/controllers/api/api.py
Show inline comments
 
@@ -436,22 +436,23 @@ class ApiController(JSONRPCController):
 
            raise JSONRPCError('ret_type must be one of %s' % _map.keys())
 
        except Exception, e:
 
            raise JSONRPCError(e)
 

	
 
    @HasPermissionAnyDecorator('hg.admin', 'hg.create.repository')
 
    def create_repo(self, apiuser, repo_name, owner_name, description='',
 
                    repo_type='hg', private=False):
 
                    repo_type='hg', private=False, clone_uri=None):
 
        """
 
        Create a repository
 
        Create repository, if clone_url is given it makes a remote clone
 

	
 
        :param apiuser:
 
        :param repo_name:
 
        :param owner_name:
 
        :param description:
 
        :param type:
 
        :param repo_type:
 
        :param private:
 
        :param owner_name:
 
        :param clone_uri:
 
        """
 

	
 
        try:
 
            owner = User.get_by_username(owner_name)
 
            if owner is None:
 
                raise JSONRPCError('unknown user %s' % owner_name)
 
@@ -474,13 +475,13 @@ class ApiController(JSONRPCController):
 
                    repo_name=real_name,
 
                    repo_name_full=repo_name,
 
                    description=description,
 
                    private=private,
 
                    repo_type=repo_type,
 
                    repo_group=parent_id,
 
                    clone_uri=None
 
                    clone_uri=clone_uri
 
                ),
 
                owner
 
            )
 
            Session.commit()
 

	
 
            return dict(
rhodecode/lib/db_manage.py
Show inline comments
 
@@ -174,13 +174,13 @@ class DbManage(object):
 
                print ('create permissions and fix groups')
 
                self.klass.create_permissions()
 
                self.klass.fixup_groups()
 

	
 
            def step_5(self):
 
                pass
 
            
 

	
 
        upgrade_steps = [0] + range(curr_version + 1, __dbversion__ + 1)
 

	
 
        # CALL THE PROPER ORDER OF STEPS TO PERFORM FULL UPGRADE
 
        for step in upgrade_steps:
 
            print ('performing upgrade step %s' % step)
 
            getattr(UpgradeSteps(self), 'step_%s' % step)()
0 comments (0 inline, 0 general)