Remove version control scripts, now replaced by aliases
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 13 Apr 2023 14:04:17 +0000 (10:04 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 1 Jun 2023 19:16:14 +0000 (15:16 -0400)
scripts/Makefile.am
scripts/vb [deleted file]
scripts/vco [deleted file]
scripts/vco-sub [deleted file]
scripts/vd [deleted file]
scripts/vl [deleted file]
scripts/vs [deleted file]
scripts/vs-sub [deleted file]

index 543edfa..6fcbe18 100644 (file)
@@ -21,7 +21,6 @@ dist_bin_SCRIPTS = \
     setdate \
     strip-debug-symbols \
     tildes-clean \
-    vb vd vl vs vs-sub vco vco-sub \
     hv-hg-functions.sh \
     hg-format-patch hg-update-subrepos \
     git-hg-sub-import git-hg-sub-update \
diff --git a/scripts/vb b/scripts/vb
deleted file mode 100755 (executable)
index b9cd822..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-VCS_SUPPORTED="GIT or Mercurial"
-
-print_usage()
-{
-    echo "$(basename $0) -- branches list for version control (${VCS_SUPPORTED})."
-    echo "Usage: $(basename $0) [OPTIONS...]"
-}
-
-if [ "x${1}" = "x--help" ]; then
-    print_usage
-    exit 1
-fi
-
-if git diff 1> /dev/null 2>&1; then
-    git branch "$@"
-elif hg status 1> /dev/null 2>&1; then
-    hg branches "$@"
-else
-    echo "Not a ${VCS_SUPPORTED} repository"
-    exit 1
-fi
diff --git a/scripts/vco b/scripts/vco
deleted file mode 100755 (executable)
index 31418a7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-VCS_SUPPORTED="GIT, Subversion or Mercurial"
-
-print_usage()
-{
-    echo "$(basename $0) -- checkout for version control (${VCS_SUPPORTED})."
-    echo "Usage: $(basename $0) [OPTIONS...]"
-}
-
-if [ "x${1}" = "x--help" ]; then
-    print_usage
-    exit 1
-fi
-
-if git diff 1> /dev/null 2>&1; then
-    git checkout "$@"
-elif svn diff 1> /dev/null 2>&1; then
-    svn co "$@"
-elif hg status 1> /dev/null 2>&1; then
-    hg update "$@"
-else
-    echo "Not a ${VCS_SUPPORTED} repository"
-    exit 1
-fi
diff --git a/scripts/vco-sub b/scripts/vco-sub
deleted file mode 100755 (executable)
index a1a2275..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-SCRIPT="`readlink -e $0`"
-SCRIPTPATH=$(dirname ${SCRIPT})
-source ${SCRIPTPATH}/hv-hg-functions.sh
-
-PROG_NAME=$(basename $0)
-
-# Version control checkout 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 checkout"
-    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 [ ${#} -eq 0 ]; then
-    echo "${PROG_NAME}: Missing branch name."
-    echo "Try \`${PROG_NAME} --help' for more information."
-    exit 1
-elif [ ${#} -gt 1 ]; then
-    echo "${PROG_NAME}: Too many arguments."
-    echo "Try \`${PROG_NAME} --help' for more information."
-    exit 1
-fi
-
-branch=${1}
-
-if [ ! -f .hgsub ]; then
-    echo "No Mercurial subrepositories found"
-    exit 1
-fi
-
-checkout_branch()
-{
-    if [ ${#} -eq 0 ]; then
-        echo "${PROG_NAME}: Missing branch name."
-        exit 1
-    fi
-
-    local branch=${1}
-
-    if vb | egrep -q "^\s+${branch}$" ; then
-                # Branch found
-        vco ${branch} 1> /dev/null 2>&1
-        if [ -n "${debug}" ]; then
-            echo "Changing branch"
-            echo # Blank line
-        fi
-    elif vb | egrep -q "^\**\s+${branch}$" ; then
-        if [ -n "${debug}" ]; then
-            echo "Already on branch"
-            echo # Blank line
-        fi
-    else
-        if [ -n "${debug}" ]; then
-            echo "Branch not found"
-            echo # Blank line
-        fi
-    fi
-}
-
-# Switch branch on main assembly
-if [ -n "${debug}" ]; then
-    dest="Top assembly"
-    display_subrepo_name
-fi
-checkout_branch ${branch}
-
-# Read lines from .hgsub
-while read sub; do
-    # Remove CR (DOS)
-    sub="${sub//$'\r'/}"
-
-    if [ "${sub}" != "" ]; then
-        # 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
-            display_subrepo_name
-        fi
-
-        if [ -d "${dest}" ]; then
-            pushd "${dest}" 1> /dev/null
-            checkout_branch ${branch}
-            popd 1> /dev/null
-        else
-            display_subrepo_name
-            echo "Error: missing local subrepository"
-            echo # Blank line
-        fi
-    fi
-done < .hgsub
diff --git a/scripts/vd b/scripts/vd
deleted file mode 100755 (executable)
index 9eb09a5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-VCS_SUPPORTED="GIT, Subversion or Mercurial"
-
-print_usage()
-{
-    echo "$(basename $0) -- diff for version control (${VCS_SUPPORTED}) with color output."
-    echo "Usage: $(basename $0) [OPTIONS...]"
-}
-
-if [ "x${1}" = "x--help" ]; then
-    print_usage
-    exit 1
-fi
-
-if git diff 1> /dev/null 2>&1; then
-    git diff "$@"
-elif svn diff 1> /dev/null 2>&1; then
-    svn diff --diff-cmd colordiff -x "-u -w -p" "$@" | less -RFX
-elif hg status 1> /dev/null 2>&1; then
-    hg diff "$@"
-else
-    echo "Not a ${VCS_SUPPORTED} repository"
-    exit 1
-fi
diff --git a/scripts/vl b/scripts/vl
deleted file mode 100755 (executable)
index a680742..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-VCS_SUPPORTED="GIT, Subversion or Mercurial"
-
-GIT_LOG_BASE_OPTS="--oneline"
-HG_LOG_BASE_OPTS="--follow"
-
-print_usage()
-{
-    echo "$(basename $0) -- log for version control (${VCS_SUPPORTED})."
-    echo "Usage: $(basename $0) [OPTIONS...]"
-}
-
-if [ "x${1}" = "x--help" ]; then
-    print_usage
-    exit 1
-fi
-
-SVN_LOG_REV_INFO_COLOR=$(echo -e '\033[1;31m')  # Red
-SVN_LOG_SEPARATION_COLOR=$(echo -e '\033[1;32m')    # Green
-NORMAL=$(echo -e '\033[0m')
-
-if git diff 1> /dev/null 2>&1; then
-    git log ${GIT_LOG_BASE_OPTS} "$@"
-elif svn diff 1> /dev/null 2>&1; then
-    # Colore les lignes --------- en vert
-    # Colore en rouge les infos de la rĂ©vision
-    svn log "$@" | sed -e "s/^-\+$/${SVN_LOG_SEPARATION_COLOR}\0${NORMAL}/" \
-        -e "s/^r[0-9]\+.\+$/${SVN_LOG_REV_INFO_COLOR}\0${NORMAL}/" | less -RFX
-elif hg status 1> /dev/null 2>&1; then
-    hg glog ${HG_LOG_BASE_OPTS} "$@"
-else
-    echo "Not a ${VCS_SUPPORTED} repository"
-    exit 1
-fi
diff --git a/scripts/vs b/scripts/vs
deleted file mode 100755 (executable)
index 69709ad..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-VCS_SUPPORTED="GIT, Subversion or Mercurial"
-
-print_usage()
-{
-    echo "$(basename $0) -- status for version control (${VCS_SUPPORTED})."
-    echo "Usage: $(basename $0) [OPTIONS...]"
-    echo "Options:"
-    echo "  -h   display this help and exit"
-}
-
-if [ "x${1}" = "x--help" ]; then
-    print_usage
-    exit 1
-fi
-
-SVN_ST_UNKNOWN_COLOR=$(echo -e '\033[1;34m')  # Blue
-SVN_ST_DELETED_COLOR=$(echo -e '\033[0;31m')  # Red
-SVN_ST_MISSING_COLOR=$(echo -e '\033[1;31m')  # Red
-SVN_ST_ADDED_COLOR=$(echo -e '\033[1;32m')    # Green
-SVN_ST_MODIFIED_COLOR=$(echo -e '\033[1;33m') # Yellow
-NORMAL=$(echo -e '\033[0m')
-
-if git diff 1> /dev/null 2>&1; then
-    git status "$@"
-elif svn diff 1> /dev/null 2>&1; then
-    svn status --ignore-externals "$@" | grep -v "^X" | \
-        sed -e "s/^\?.*$/${SVN_ST_UNKNOWN_COLOR}\0${NORMAL}/" \
-        -e "s/^!.*$/${SVN_ST_MISSING_COLOR}\0${NORMAL}/" \
-        -e "s/^A.*$/${SVN_ST_ADDED_COLOR}\0${NORMAL}/" \
-        -e "s/^M.*$/${SVN_ST_MODIFIED_COLOR}\0${NORMAL}/" \
-        -e "s/^D.*$/${SVN_ST_DELETED_COLOR}\0${NORMAL}/"
-elif hg status 1> /dev/null 2>&1; then
-    hg status "$@"
-else
-    echo "Not a ${VCS_SUPPORTED} repository"
-    exit 1
-fi
diff --git a/scripts/vs-sub b/scripts/vs-sub
deleted file mode 100755 (executable)
index 061911b..0000000
+++ /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