summaryrefslogtreecommitdiff
path: root/scripts/cvsrevertlast
Side-by-side diff
Diffstat (limited to 'scripts/cvsrevertlast') (more/less context) (show whitespace changes)
-rw-r--r--scripts/cvsrevertlast14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/cvsrevertlast b/scripts/cvsrevertlast
index cfbfd56..d019c44 100644
--- a/scripts/cvsrevertlast
+++ b/scripts/cvsrevertlast
@@ -6,2 +6,8 @@
# is like a less polite version of cvsblame ;)
+##!/bin/sh
+# (C) 2001 Charles Samuels <charles@kde.org>
+#
+# This script reverts all the files given on the command
+# by one version, then you can commit them. This
+# is like a less polite version of cvsblame ;)
#
@@ -10,6 +16,5 @@ for i in $@ ;
do
-
- text=`cvs log "$i" | grep 'revision[^s]'`
- current=`echo $text | awk '{print $2}'`
- previous=`echo $text | awk '{print $4}'`
+text=`cvs status "$i" | grep '[^s]Repository revision:.*$'`
+current=`echo $text | awk '{print $3}'`
+previous=`echo $current | awk -F . '{ ORS="."; OFS="\n"; for (i=1; i<NF; i++) print $i; ORS=""; $NF-=1; print $NF }'`
echo $i... "(reverting from $current to $previous)"
@@ -18 +23,2 @@ done
+