Create library of common hg-related functions
[hvutilities.git] / scripts / vs-sub
index 89518d0..061911b 100755 (executable)
@@ -1,6 +1,10 @@
 #!/bin/bash
 set -o errexit
 
+SCRIPT="`readlink -e $0`"
+SCRIPTPATH=$(dirname ${SCRIPT})
+source ${SCRIPTPATH}/hv-hg-functions.sh
+
 # Version control status command for all subrepositories.
 # For use with git-remote-hg:
 #   http://felipec.wordpress.com/2012/11/13/git-remote-hg-bzr-2/
@@ -17,35 +21,6 @@ print_usage()
     echo "  -m   display only subrepositories with local modifications"
 }
 
-# git-remote-hg doesn't work with Mercurial subpaths extension,
-# so use it manually
-hg_subpaths_config()
-{
-    subpaths=$(hg showconfig | grep "subpaths")
-
-    if [ -n "${subpaths}" ]; then
-        sp_src=${subpaths//subpaths./}
-        sp_src=${sp_src//=*/}
-        sp_src=${sp_src//\\/} # Remove windows separator (LSI)
-        sp_dst=${subpaths//*=/}
-
-        if [ -n "${debug}" ]; then
-            echo "sp_src = $sp_src"
-            echo "sp_dst = $sp_dst"
-        fi
-    fi
-}
-
-display_subrepo_name()
-{
-    COLOR_BLUE='\033[1;34m'
-    COLOR_NORMAL='\033[0m'
-
-    echo -en "${COLOR_BLUE}"
-    echo "${dest}"
-    echo -en "${COLOR_NORMAL}"
-}
-
 if [ "x${1}" = "x--help" ]; then
     print_usage
     exit 1