#!/bin/sh # Author: Erik Christiansen (23.02.01) if [ $# != 1 ] ; then cat << EOF Usage: cvs_unconflict file If file contains conflicts from a cvs merge, cvs_unconflict uses sdiff to select between the alternatives at each conflict. Answer l or r to select. If a mistake is made, do not answer y or Y to the overwrite query. EOF exit fi dir=/tmp/ccr_$USER /bin/rm -rf $dir left=${dir}/left right=${dir}/right mkdir $dir result=${dir}/result nawk ' BEGIN { to = "LR" } /^<>/ { to = "LR" ; next } to ~ /L/ { print >> left } to ~ /R/ { print >> right } ' left=$left right=$right $1 sdiff -s -o ${dir}/result $left $right echo Overwrite original file? read x if [ $x = y ] || [ $x = Y ] ; then mv ${dir}/result $1 echo mv ${dir}/result $1 fi