From 825759177827dc9c57dc4dbc0ede8848eaa72b64 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 2 Sep 2005 00:21:32 +0000 Subject: Add some stuff git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@2 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- rvi | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 rvi (limited to 'rvi') diff --git a/rvi b/rvi new file mode 100755 index 0000000..c43226b --- /dev/null +++ b/rvi @@ -0,0 +1,35 @@ +#!/bin/sh + +if ! [ -e "$1" ] ; then + echo "$1 does not exist." >&2 + exit 1 +fi + +DN=`dirname "$1"` +BN=`basename "$1"` +if ! [ -e "$1,v" ] && ! [ -e "$DN/RCS/$BN,v" ] ; then + echo "Neither $1,v nor $DN/RCS/$BN,v do not exist." >&2 + exit 1 +fi + +rcsdiff -u $1 +if [ $? -ne 0 ] ; then + rcsdiff $1 > $1.rvi.diff + echo + echo "Differences detected" + echo "run 'co $1' to overwrite with last committed version" + echo "or 'co -l $1; patch $1 < $1.rvi.diff; ci -u $1' to commit" + exit 1 +fi +rm -f $1.rvi.diff + +co -l $1 +if [ $? -ne 0 ] ; then + echo "Check out failed." + echo "Maybe someone else is currently editing this file." + echo "Aborting rvi." + exit 1 +fi +/usr/bin/vim $1 +ci -u $1 + -- cgit v1.2.3