From 6e209568ae09f6fd3384bf9cdcfb7f868ceca2b5 Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Wed, 4 Jan 2006 12:51:44 +0000 Subject: [PATCH] * svkci: New. Copied from 'svnci', with 's,svn,svk,'. svn path=/trunk/svn-tools/; revision=55051 --- ChangeLog | 4 ++++ svkci | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100755 svkci diff --git a/ChangeLog b/ChangeLog index aa33bf6..024b730 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-01-04 Raja R Harinath + + * svkci: New. Copied from 'svnci', with 's,svn,svk,'. + 2005-06-01 Raja R Harinath * svnci: Fix typo. diff --git a/svkci b/svkci new file mode 100755 index 0000000..ff24cb2 --- /dev/null +++ b/svkci @@ -0,0 +1,54 @@ +#! /bin/bash + +FILES=$@ + +echo "Creating commit message..." + +MSG=`mktemp` + +svk di $FILES | filterdiff -i'*ChangeLog' | + sed -e '/^[^+]/d' -e 's,^[+],,' -e '/^[^+]/b' -e 's,^[+][+],In,' -e 's,/ChangeLog.*$,:,' -e 's,ChangeLog.*$,.:,' >> $MSG + +case $(grep '^In' $MSG | wc -l) in +1) (echo 1d; echo w; echo q) | ed - $MSG ;; +*) ;; +esac + +cat $MSG + +echo About to commit +svk st $FILES + +while [[ 1 ]] +do + + read -a RESPONSE -p"Would you like to continue (Y)es/(N)o/(E)dit Message: " + if [[ $? != 0 ]] + then + RESPONSE="N" + fi + + case $RESPONSE in + "Y" | "y" | "yes" | "Yes") + + echo "Committing..." + svk ci -F $MSG $FILES + rm $MSG + exit 0 + ;; + + "N" | "n" | "no" | "No") + echo "Aborting..." + rm $MSG + exit 1 + ;; + + "E" | "e" | "ed" | "Ed" | "Edit" | "edit") + vi $MSG + # try again + ;; + *) + # try again + ;; + esac +done