diff --git a/add_mirror.sh b/add_mirror.sh index 662a43868a219404b8552038e73728091e122827..78bb85deb77f5ec0445b9748348addf63c08773f 100755 --- a/add_mirror.sh +++ b/add_mirror.sh @@ -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