function url_hg_crack() {

  URL=$(url_strip_prefix "$1" hg_http)
  HG_ROOT=$(echo $URL | sed "s#\(^[^/]*[^:]*\):.*#\1#")
  local HG_MODULE_TAG=$(echo $URL | sed "s#^[^/]*[^:]*\(.*\)#\1#")
  HG_MODULE=$(echo $HG_MODULE_TAG | cut -d : -f2)
  local HG_TAGNAME=$(echo $HG_MODULE_TAG | cut -d : -f3)
  HG_TAG=${HG_TAGNAME:-tip}

}
if [[ $OSS_BRANCH == scm ]]; then
url_hg_crack ${SOURCE_URL}
message "${MESSAGE_COLOR}Starting Mercurial checkout of" \
        "${FILE_COLOR}${SOURCE}${MESSAGE_COLOR}...${DEFAULT_COLOR}"  &&
if [[ -f $SOURCE_CACHE/${SOURCE} ]]
then
  message "${MESSAGE_COLOR}Previous source found unpacking...${DEFAULT_COLOR}"  &&
  tar -jxf $SOURCE_CACHE/${SOURCE}  &&
  cd ${HG_MODULE}  &&
  message "${MESSAGE_COLOR}Running Mercurial update...${DEFAULT_COLOR}"  &&
  hg pull -u -r ${HG_TAG}
  cd ..
  message "${MESSAGE_COLOR}Done...${DEFAULT_COLOR}"
else
  message "${MESSAGE_COLOR}Running initial Mercurial clone...${DEFAULT_COLOR}"  &&
  hg clone -r${HG_TAG} "http://${HG_ROOT}" ${HG_MODULE}
  message "${MESSAGE_COLOR}Done...${DEFAULT_COLOR}"
fi   &&
message "${MESSAGE_COLOR}Generating tarball...${DEFAULT_COLOR}" &&
tar -jcf                                                        \
    ${SOURCE}                                                   \
    ${HG_MODULE}                                                &&
cp  ${SOURCE} ${SOURCE_CACHE}/${SOURCE}                         &&
rm  ${SOURCE}                                                   &&
message "${MESSAGE_COLOR}Mercurial checkout complete...${DEFAULT_COLOR}"
else
  acquire_src ''
fi
