Skip to content
Snippets Groups Projects
Commit 2b2b95b8 authored by agb80's avatar agb80
Browse files

Added bzr support (Initial commit)

parent 25f06522
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ DESCRIPTION: ...@@ -63,6 +63,7 @@ DESCRIPTION:
--svn Mirror a SVN repository (must be explicitly set) --svn Mirror a SVN repository (must be explicitly set)
--bzr Mirror a Bazar repository (must be explicitly set)
EOF EOF
} }
...@@ -89,6 +90,10 @@ while true; do ...@@ -89,6 +90,10 @@ while true; do
svn=true svn=true
shift shift
;; ;;
--bzr)
bzr=true
shift
;;
-f|--force) -f|--force)
force=true force=true
set +e set +e
...@@ -347,6 +352,22 @@ elif ${svn};then ...@@ -347,6 +352,22 @@ elif ${svn};then
git push gitlab git push gitlab
git config --bool core.bare false git config --bool core.bare false
green_echo "All done!" 1>&2 green_echo "All done!" 1>&2
elif ${bzr};then
#create a mirror
green_echo "Creating mirror from ${mirror}" 1>&2
cd "${repo_dir}/${gitlab_namespace}"
git clone bzr::"${mirror}" "${project_name}"
# cleaning repo
cd "${project_name}"
git gc --aggressive
#add the gitlab remote
git remote add gitlab "${gitlab_remote}"
git config --add remote.gitlab.push '+refs/heads/*:refs/heads/*'
git config --add remote.gitlab.push '+refs/tags/*:refs/tags/*'
#Check the initial repository into gitlab
green_echo "Checking the mirror into gitlab." 1>&2
git push gitlab
green_echo "All done!" 1>&2
else else
red_echo "Something has gone very wrong. You should never see this message." red_echo "Something has gone very wrong. You should never see this message."
exit 1 exit 1
......
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