Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gitlab-mirrors
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wonko
gitlab-mirrors
Commits
9de443ae
Commit
9de443ae
authored
11 years ago
by
Git Mirror
Browse files
Options
Downloads
Plain Diff
Merge branch 'development' release v0.2.5
parents
81537c2f
c0097c22
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CHANGELOG
+6
-0
6 additions, 0 deletions
CHANGELOG
README.md
+1
-1
1 addition, 1 deletion
README.md
docs/prerequisites.md
+4
-3
4 additions, 3 deletions
docs/prerequisites.md
lib/VERSION
+1
-1
1 addition, 1 deletion
lib/VERSION
lib/manage_gitlab_project.py
+11
-4
11 additions, 4 deletions
lib/manage_gitlab_project.py
with
23 additions
and
9 deletions
CHANGELOG
+
6
−
0
View file @
9de443ae
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.
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
9de443ae
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
docs/prerequisites.md
+
4
−
3
View file @
9de443ae
...
...
@@ -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
This diff is collapsed.
Click to expand it.
lib/VERSION
+
1
−
1
View file @
9de443ae
VERSION="v0.2.
4
"
VERSION="v0.2.
5
"
This diff is collapsed.
Click to expand it.
lib/manage_gitlab_project.py
+
11
−
4
View file @
9de443ae
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment