#!/bin/bash
#
# Script that checks for any drift between CVS and our git repo
#

pushd /git/import/moodle/drift_detection > /dev/null

for branch in MOODLE_16_STABLE MOODLE_17_STABLE MOODLE_18_STABLE MOODLE_19_STABLE cvshead
do
	pushd cvs/$branch > /dev/null
	cvs -Q update -dP
	popd > /dev/null
	pushd moodle-r2 > /dev/null
	git-checkout -q $branch
	git-pull -q > /dev/null 2>&1
	popd > /dev/null
	~/scripts/bin/smartdiff moodle-r2 cvs/$branch > /dev/null || echo "git-cvs drift detected in $branch"
done

popd > /dev/null

