summaryrefslogtreecommitdiffstats
path: root/scripts/cvsrevertlast
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cvsrevertlast')
-rwxr-xr-xscripts/cvsrevertlast17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/cvsrevertlast b/scripts/cvsrevertlast
new file mode 100755
index 00000000..96808514
--- /dev/null
+++ b/scripts/cvsrevertlast
@@ -0,0 +1,17 @@
+#!/bin/sh
+# (C) 2001 Charles Samuels <[email protected]>
+#
+# 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 ;)
+#
+
+for i in $@ ;
+do
+ 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)"
+ cvs up -j $current -j $previous $i
+done
+