diff --git a/libraries/repositories b/libraries/repositories index 773d9a7..f4aa540 100644 --- a/libraries/repositories +++ b/libraries/repositories @@ -52,9 +52,10 @@ function pullMercurial() { run "hg recover" run "hg revert -aC" || return 1 run "hg purge" || return 1 - run "hg pull --update" || return 1 + run "hg pull --update -e ${BINDIR}/ssh_wrapper.sh" || return 1 else - run "hg clone ${ADDRESS} ${DIRECTORY}" || return 1 + run "hg clone ${ADDRESS} ${DIRECTORY} -e ${BINDIR}/ssh_wrapper.sh" \ + || return 1 if [ ${BRANCH} != "default" ]; then run "hg branch ${BRANCH}" || return 1 fi @@ -144,6 +145,21 @@ function pushGit() { return 0 } +function pushMercurial() { + local DIRECTORY="${1}" + local MESSAGE="${2}" + local STATUS + [ ! -d ${DIRECTORY} ] && return 1 + cd ${DIRECTORY} + run "hg add ." || return 1 + STATUS=$(hg status) + if [ "${STATUS}" != "" ]; then + run "hg commit -A -m ${MESSAGE}" || return 1 + run "hg push -e ${BINDIR}/ssh_wrapper.sh" || return 1 + fi + return 0 +} + #------------------------------------------------------------------------------- # Sends an update to specified remote repository regardless its protocol # Parameters: %directory% %protocol% %message% @@ -153,6 +169,9 @@ function pushRepository() { [Gg][Ii][Tt]) pushGit "${1}" "${3}" && return 0 ;; + [Hh][Gg]) + pushMercurial "${1}" "${3}" && return 0 + ;; *) printWarn "Tried to push data using unsupported protocol (${2})!" ;;