Skip to content
Snippets Groups Projects
Commit 1ebe88a6 authored by Sam Gleske's avatar Sam Gleske
Browse files

Merge branch 'upgrade-pyapi-gitlab' into development

parents 911e5b6e 4150d73a
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
### Required software ### Required software
* [GitLab 6.x][1] * [GitLab 6.x][1]
* [python-gitlab @ 9c5e375][2] * [pyapi-gitlab @ 4d778d7][2]
* [GNU coreutils][3] * [GNU coreutils][3]
* [git 1.8.4][4] * [git 1.8.4][4]
...@@ -17,7 +17,7 @@ python-gitlab ...@@ -17,7 +17,7 @@ python-gitlab
yum install python-setuptools yum install python-setuptools
git clone https://github.com/Itxaka/python-gitlab.git git clone https://github.com/Itxaka/python-gitlab.git
cd python-gitlab cd python-gitlab
git checkout 9c5e375599a6d89ab1f4520224f47b43b40bcf9b git checkout 4d778d780161869550d8e514cdc50df2398f844e
python setup.py install python setup.py install
You can find the source to git at the [git-core project][5]. For instructions on other platforms see the [Getting Started - Installing Git section of the git book][6]. You can find the source to git at the [git-core project][5]. For instructions on other platforms see the [Getting Started - Installing Git section of the git book][6].
...@@ -39,7 +39,7 @@ Your git should now be located in `/usr/local/bin/git`. You should edit `/etc/p ...@@ -39,7 +39,7 @@ Your git should now be located in `/usr/local/bin/git`. You should edit `/etc/p
Next up is [Installation and Setup](installation.md). Next up is [Installation and Setup](installation.md).
[1]: https://github.com/gitlabhq/gitlabhq/tree/6-0-stable [1]: https://github.com/gitlabhq/gitlabhq/tree/6-0-stable
[2]: https://github.com/Itxaka/python-gitlab [2]: https://github.com/Itxaka/pyapi-gitlab
[3]: http://www.gnu.org/software/coreutils/ [3]: http://www.gnu.org/software/coreutils/
[4]: http://git-scm.com/ [4]: http://git-scm.com/
[5]: http://code.google.com/p/git-core/ [5]: http://code.google.com/p/git-core/
......
VERSION="v0.2.10" VERSION="v0.2.11pre"
...@@ -38,16 +38,13 @@ elif len(args) > 1: ...@@ -38,16 +38,13 @@ elif len(args) > 1:
project_name=args[0] project_name=args[0]
#current python-gitlab behavior git=gitlab.Gitlab(host=gitlab_url,user=gitlab_user,token=token_secret)
#git=gitlab.Gitlab(gitlab_url,token_secret,version=6)
#command for my forked version https://github.com/sag47/python-gitlab.git
git=gitlab.Gitlab(gitlab_url,token_secret)
def findgroup(gname): def findgroup(gname):
#Locate the group #Locate the group
page=1 page=1
while len(git.getGroups(page=page)) > 0: while len(git.getgroups(page=page)) > 0:
for group in git.getGroups(page=page): for group in git.getgroups(page=page):
if group['name'] == gname: if group['name'] == gname:
return group return group
page += 1 page += 1
...@@ -58,8 +55,8 @@ def findgroup(gname): ...@@ -58,8 +55,8 @@ def findgroup(gname):
def findproject(gname,pname,user=False): def findproject(gname,pname,user=False):
page=1 page=1
while len(git.getProjects(page=page)) > 0: while len(git.getprojects(page=page)) > 0:
for project in git.getProjects(page=page): for project in git.getprojects(page=page):
if not user and project['namespace']['name'] == gname and project['name'] == pname: if not user and project['namespace']['name'] == gname and project['name'] == pname:
return project return project
elif user and project['namespace']['path'] == gname and project['name'] == pname: elif user and project['namespace']['path'] == gname and project['name'] == pname:
...@@ -76,10 +73,10 @@ def createproject(pname): ...@@ -76,10 +73,10 @@ def createproject(pname):
description="Git mirror of %s." % project_name description="Git mirror of %s." % project_name
else: else:
description=options.desc description=options.desc
new_project=git.createProject(pname,description=description,issues_enabled=int(options.issues),wall_enabled=int(options.wall),merge_requests_enabled=int(options.merge),wiki_enabled=int(options.wiki),snippets_enabled=int(options.snippets),public=int(options.public)) new_project=git.createproject(pname,description=description,issues_enabled=int(options.issues),wall_enabled=int(options.wall),merge_requests_enabled=int(options.merge),wiki_enabled=int(options.wiki),snippets_enabled=int(options.snippets),public=int(options.public))
if gitlab_user != gitlab_namespace: if gitlab_user != gitlab_namespace:
new_project=findproject(gitlab_user,pname,user=True) new_project=findproject(gitlab_user,pname,user=True)
new_project=git.moveProject(found_group['id'],new_project['id']) new_project=git.moveproject(found_group['id'],new_project['id'])
if findproject(gitlab_namespace,pname): if findproject(gitlab_namespace,pname):
return findproject(gitlab_namespace,pname) return findproject(gitlab_namespace,pname)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment