X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Fvs-sub;fp=scripts%2Fvs-sub;h=0000000000000000000000000000000000000000;hb=30c9bf42074e6b4ff0fced70041c0def07e23aa1;hp=061911b15424c79b3858befcec6bc7fc7878dc52;hpb=9c4b89cf4f92b8f02fa2d42016b553d24536030f;p=hvutilities.git diff --git a/scripts/vs-sub b/scripts/vs-sub deleted file mode 100755 index 061911b..0000000 --- a/scripts/vs-sub +++ /dev/null @@ -1,84 +0,0 @@ -#!/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/ - -# Uncomment to have verbose debug output -#debug=1 - -print_usage() -{ - echo "$(basename $0) -- Version control subrepository status" - echo "Usage: $(basename $0) [OPTIONS...]" - echo "Options:" - echo " -h display this help and exit" - echo " -m display only subrepositories with local modifications" -} - -if [ "x${1}" = "x--help" ]; then - print_usage - exit 1 -fi - -if [ ! -f .hgsub ]; then - echo "No Mercurial subrepositories found" - exit 1 -fi - -if [ ! -f .gitignore ]; then - # We do not want to track .gitignore itself - echo ".gitignore" > .gitignore -fi - -hg_subpaths_config - -# Read lines from .hgsub -while read sub; do - # Remove CR (DOS) - sub="${sub//$'\r'/}" - - if [ "${sub}" != "" ]; then - # Get subrepository URL - src="${sub//*= /}" - - # Replace using subpaths extension content - src=${src/${sp_src}/${sp_dst}} - - # Get subrepository local alias or label - dest="${sub// =*}" - - # Get project ID (example: S0289) - id=$(echo ${sub} | sed "s/.*\(S[0-9][0-9][0-9][0-9]\).*/\1/") - - if [ -n "${debug}" ]; then - echo "repo: ${src}" - echo " id: ${id}" - echo " src: ${src}" - echo " dest: ${dest}" - fi - - if [ -d "${dest}" ]; then - pushd "${dest}" 1> /dev/null - - changed=$(vs --porcelain) - - if [ -n "${changed}" ]; then - display_subrepo_name - vs -s - echo # Blank line - fi - - popd 1> /dev/null - else - display_subrepo_name - echo "Error: missing local subrepository" - echo # Blank line - fi - fi -done < .hgsub