Improved the git and hg logic in deps package and some changes to exec