To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / SCRIPTS / check-changes.sh

History | View | Annotate | Download (978 Bytes)

1
#!/bin/bash
2

    
3
verbose=false
4
if [ "$1" = "-v" ]; then
5
    verbose=true
6
fi
7

    
8
set -eu
9

    
10
# Run this from the top-level vamp-build-and-test directory
11

    
12
cat METADATA/repos.txt | grep -v '^#' | awk -F= '{ print $1 }' |
13
    while read name; do
14
	( if ! cd "$name" 2>/dev/null; then
15
              echo "$name: missing"
16
          elif [ -d .hg ]; then
17
	      nchanged=$(hg st -dram | wc -l | awk '{ print $1; }')
18
	      phase=$(hg phase . | awk '{ print $2; }')
19
	      if [ "$nchanged" != "0" ]; then
20
		  if [ "$phase" != "public" ]; then
21
		      echo "$name: uncommitted, unpushed"
22
		  else
23
		      echo "$name: uncommitted"
24
		  fi
25
	      elif [ "$phase" != "public" ]; then
26
		  echo "$name: unpushed"
27
	      elif [ "$verbose" = "true" ]; then
28
		  echo "$name: ok"
29
	      fi
30
	  elif [ -d .git ]; then
31
	      changes=$(git diff --numstat)
32
	      if [ "$changes" != "" ]; then
33
		  echo "$name: changed"
34
	      elif [ "$verbose" = "true" ]; then
35
		  echo "$name: ok"
36
	      fi
37
	  fi
38
	)
39
    done