summaryrefslogtreecommitdiff
path: root/rvi
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2005-09-02 00:21:32 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2005-09-02 00:21:32 +0000
commit825759177827dc9c57dc4dbc0ede8848eaa72b64 (patch)
treeea23ede3810e1e4ba882fc0d415bd06f6b9809b0 /rvi
parent92603bccb2fc25f27eeead40079cd33a10886e9f (diff)
Add some stuff
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@2 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'rvi')
-rwxr-xr-xrvi35
1 files changed, 35 insertions, 0 deletions
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
+