diff --git a/CHANGELOG b/CHANGELOG index e4b474c4f05dd1e319290a26c80a1d140c052936..df8df57d160b0a85f05be31acb0164dedbc4c714 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +gitlab-mirrors v0.2.5 +* Fixed a critical bug with pagination when user can view more projects than 20. + * Had to patch upstream python-gitlab library for this functionality. +* Updated documentation to reference my bugfix-edition of python-gitlab in the + prerequisites. + gitlab-mirrors v0.2.4 * Fixing critical git svn mirror bug. diff --git a/README.md b/README.md index 7c1f03bfdd67b36fa0cc5ae85b03c55e550219f9..2231bb78f8e6c7d969fbf39d66f47667b04af80b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Created by Sam Gleske under [MIT License](LICENSE). This project is meant to te * [How to convert a git repository from normal to bare][11] [1]: https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/README.md -[2]: https://github.com/Itxaka/python-gitlab +[2]: https://github.com/sag47/python-gitlab [3]: http://feedback.gitlab.com/forums/176466-general/suggestions/4286666-mirror-git-svn-into-repo- [4]: http://feedback.gitlab.com/forums/176466-general/suggestions/3697598-feature-request-multi-master-mirroring [5]: http://stackoverflow.com/questions/2756747/mirror-a-git-repository-by-pulling diff --git a/docs/prerequisites.md b/docs/prerequisites.md index 4b234ac7b16d38d95208db00827c619e53493fde..e114b8c81bc2ee6e2e4c079257da2a84d5e88e1a 100644 --- a/docs/prerequisites.md +++ b/docs/prerequisites.md @@ -3,7 +3,7 @@ ### Required software * [GitLab 6.x][1] -* [python-gitlab @ 2ec0ba5][2] +* [python-gitlab][2] (note due to certain bugs you should obtain my fork [python-gitlab @ 6d6b270][8]) * [GNU coreutils][3] * [git 1.8.4][4] @@ -15,9 +15,9 @@ If you plan on mirroring SVN repositories as well then you'll need the following python-gitlab yum install python-setuptools - git clone https://github.com/Itxaka/python-gitlab.git + git clone https://github.com/sag47/python-gitlab.git cd python-gitlab - git checkout 2ec0ba588a1cce00bb1fde74bb7403cc9ab1ff5e + git checkout 6d6b270e9829012b99d700eb1ca3802ef05f40b4 python setup.py 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]. @@ -45,3 +45,4 @@ Next up is [Installation and Setup](installation.md). [5]: http://code.google.com/p/git-core/ [6]: http://git-scm.com/book/en/Getting-Started-Installing-Git [7]: https://www.kernel.org/pub/software/scm/git/docs/git-svn.html +[8]: https://github.com/sag47/python-gitlab/tree/bugfix-edition diff --git a/lib/VERSION b/lib/VERSION index 50c673d95a37d351ec03ac3c61eba6953fda20c0..37529d69b8f95ca3fdb7b112a833596490ac8653 100644 --- a/lib/VERSION +++ b/lib/VERSION @@ -1 +1 @@ -VERSION="v0.2.4" +VERSION="v0.2.5" diff --git a/lib/manage_gitlab_project.py b/lib/manage_gitlab_project.py index 5452e15d4a1a805d7da1f01cf9614ce98272e14c..49edf42c32fde6ff66caf19162a123498806f2ca 100755 --- a/lib/manage_gitlab_project.py +++ b/lib/manage_gitlab_project.py @@ -38,7 +38,10 @@ elif len(args) > 1: project_name=args[0] -git=gitlab.Gitlab(gitlab_url,token_secret,version=6) +#current python-gitlab behavior +#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): #Locate the group @@ -52,9 +55,12 @@ def findgroup(gname): exit(1) def findproject(gname,pname): - for project in git.getProjects(): - if project['namespace']['name'] == gname and project['name'] == pname: - return project + page=1 + while len(git.getProjects(page=page)) > 0: + for project in git.getProjects(page=page): + if project['namespace']['name'] == gname and project['name'] == pname: + return project + page += 1 else: return False @@ -68,6 +74,7 @@ def createproject(pname): description=options.desc new_project=git.createProject(pname,description=description,issues_enabled=str(int(options.issues)),wall_enabled=str(int(options.wall)),merge_requests_enabled=str(int(options.merge)),wiki_enabled=str(int(options.wiki)),snippets_enabled=str(int(options.snippets)),public=str(int(options.public))) new_project=findproject(gitlab_user,pname) + print new_project new_project=git.moveProject(found_group['id'],new_project['id']) if findproject(gitlab_namespace,pname): return findproject(gitlab_namespace,pname)