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

hg mirror logic

parent ceae2379
No related branches found
No related tags found
No related merge requests found
......@@ -439,6 +439,22 @@ elif ${bzr};then
green_echo "Checking the mirror into gitlab." 1>&2
git push gitlab
green_echo "All done!" 1>&2
elif ${hg};then
#create a mirror
green_echo "Creating mirror from ${mirror}" 1>&2
cd "${repo_dir}/${gitlab_namespace}"
git clone --mirror hg::"${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
red_echo "Something has gone very wrong. You should never see this message."
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