#!/bin/sh

MERGE_LOG=${1:-cvs.log}

echo ---------------------------------------------------------------------------
echo Conflicts
echo ---------------------------------------------------------------------------
grep -B 4 "conflicts during merge" "$MERGE_LOG" \
  | grep "^RCS file:" \
  | sed "s|^RCS file:.*fwcomponents/\(.*\),v|Conflict in: \1|" \
  | sed "s|^RCS file:.*/srv/CVS/\(.*\),v|Conflict in: \1|"
echo

echo ---------------------------------------------------------------------------
echo Files that have been removed in the branch you actually merge into
echo
echo Probably a file has been renamed and you have to merge the changes by hand!
echo ---------------------------------------------------------------------------
grep "does not exist, but is present in revision" "$MERGE_LOG" \
  | sed "s#^cvs \(update\|checkout\): file \(.*\) does not.*#Removed in target branch: \2#"
echo

echo ---------------------------------------------------------------------------
echo Files that have been removed in the branch you actually merging
echo
echo Probably a file has been renamed and you have to merge the changes by hand!
echo ---------------------------------------------------------------------------
grep "has been modified, but has been removed in revision" "$MERGE_LOG" \
  | sed "s#^cvs \(update\|checkout\): file \(.*\) has been modified.*#Removed in source branch: \2#"
echo
