Commits

Alain Leufroy  committed a218b5d

[Hg] usefull script to recurse over directories

  • Participants
  • Parent commits eed0efd

Comments (0)

Files changed (1)

+#! /bin/bash
+export GREP_OPTIONS=
+
+excludes=""
+if [[ "x$1" == "x-e" ]]; then excludes="$2"; shift 2; fi
+echo "$excludes"
+
+curdir=$PWD
+
+find -L . -name .hg -type d|grep -v patches|while read d; do
+    if [ -d "$d" ];then
+        repo_path=$(dirname "$d")
+        echo -e "\033[36;1m${repo_path}\033[0m"
+        echo "$excludes" | grep -q "$repo_path" \
+            && echo -e "\033[35m skiped\033[0m" \
+            || (cd "$repo_path" && hg "$@" | tee -a hgr.log)
+            
+        cd $curdir;
+    fi
+done
+
+echo -e '--\n\033[32moutputs saved in "./hgr.log"\033[0m'