[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference smurf::buildhelp

Title:USG buildhelp questions/answers
Moderator:SMURF::FILTER
Created:Mon Apr 26 1993
Last Modified:Mon Jan 20 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2763
Total number of notes:5802

226.0. "rcs history information..." by SMURF::FILTER (Automatic Posting Software - mail to flume::puck) Tue Jul 20 1993 14:43

Date Of Receipt: 	20-JUL-1993 13:32:45.73
From: 	ALPHA::"[email protected]" "Michael D. Fairbrother UEG  20-Jul-1993 1332"
To: 	[email protected]
CC: 	[email protected], [email protected]
Subj: 	rcs history information...

Anyone got any better methods for obtaining the history information
for files that are being worked on in a sandbox!  Ideally I would like
to get to the point of just having to enter the descriptive information
in the rcs-history header only once.  And tweek my srequest to take that
information and supply it in the srequest form for me... 8^)

Here's my first stab at the script to get history information, I not
too pleased with it but it's a starting point...

If there's a better mail alias or other users who may be able to provide
feed-back please let me know.

ps.
	I think the file is all here, so if you want to give it a try
(I use lots of ksh functions so I might of missed one or two).

#!/usr/bin/ksh -p
#
# Program: hi	(history information)
#
# This program displays the history information for the files listed
# on the command line, the -all option will display all the history 
# information for all the files in the set.
# 
#
OPTIONS=":a"					# allowable command line 
options.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

#
# Letters(count, word)
#
#       count           - numbers of letters to return.
#       word            - word which contains letters.
#
function Letters
{
	COUNT=$1
	WORD=$2
	if [ -n "${WORD}" ]
	then	
		print $(expr "${WORD}" : '\('$(Loop ${COUNT} .)'\)')
	fi
}

function Loop
{
	typeset -i _COUNT_=$1
	_VALUE_=$2
	_RETURN_=""
	while :
	do
		_RETURN_="${_RETURN_}${_VALUE_}"
		_COUNT_=$(( ${_COUNT_} - 1 ))
		if [ ${_COUNT_} = 0 ]
		then
			break
		fi
	done
	print ${_RETURN_}
}
		

set -- $(getopt ${OPTIONS} $*) || {
	print -u2 "unsupported option"
	exit 1
}

for arg in $*
do case ${arg} in
	-a ) FILES="$1$2"; shift 2;; 		# special case to handle -all
	--) shift; break;;
   esac
done

if [ $# -gt 0 ]				# any left over arguments are
then					# assumed to be files.
	FILES=$*
fi
FILES=${FILES:="-all"}			# If FILES is not defined then set it 
					# to -all files.

SANDBOX_BASE=$(sbinfo sandbox_base)
HISTORY_FILE=${SOURCEBASE}/.BCSlog-${PRINCIPAL}_${SANDBOX_BASE##*/}

if [ "${FILES}" = "-all" ]
then
	more ${HISTORY_FILE}
	exit 0
fi

for FILE in ${FILES}
do
	case ${FILE} in 
		*\/*)
			SB_DIR=$(dirname ${FILE})
			;;

		*)	# Strip down to find current sandbox dir.
			SB_DIR=${PWD}
			;;
	esac
	CSD="."${SB_DIR##*${SOURCEBASE}}	
	FILE=$(basename ${FILE})
	INDEX=$(grep -n ${CSD}/${FILE} ${HISTORY_FILE} | awk -F: '{ print $1 }')
	INFO="${CSD}/${FILE}:"
	for LOCATION in ${INDEX}
	do
		exec 3< ${HISTORY_FILE}		# Open file descriptor 3.
		COUNT=0
		while read -u3 LINE
		do 
			if [ ${COUNT} -lt ${LOCATION} ]
			then
				COUNT=$(( ${COUNT} + 1))
			else
				FIRST_LETTER=$(Letters 1 "${LINE}")
				if [ "X${FIRST_LETTER}X" = "X[X" ]
				then
					break
				else
					INFO="${INFO} \n${LINE}"
					COUNT=$(( ${COUNT} + 1 ))
				fi
			fi
		done
	done
	exec 3<&-			# Close file descriptor 3.
	print ${INFO}

done


Michael D. Fairbrother			[email protected]				
Digital Equipment Corporation		Phone: 603-881-2399
USG/Base Operating Sytems		DTN: 381-2399
110 Spit Brook Rd			FAX: 603-881-2257
Nashua, NH 03062-2698								
MS ZK3-3/U14									

T.RTitleUserPersonal
Name
DateLines
226.1Re: rcs history information...SMURF::FILTERAutomatic Posting Software - mail to flume::puckMon Jul 26 1993 16:1233
Date Of Receipt: 	22-JUL-1993 11:26:54.77
From: 	WASTED::jmf "Joshua M. Friedman ULTRIX SDE  22-Jul-1993 1126"
To: 	"Michael D. Fairbrother" <mdf@wasted:zko.dec>
CC: 	odehelp@wasted:zko.dec, jmcg@wasted:zko.dec, dutile@wasted:zko.dec
Subj: 	Re: rcs history information...
Mike, this is from lastin: 	/usr/sde/ode1.5/man/man1/bci.1 -- this information

is really internal to the workings of bci, and so it was removed from the
ode man page for version 2.0.  You may be able to use this to pull the rcs
history from the file in some way...	-josh

  -xlog rev[,rev...]
       Obtains log messages for file by extracting all RCS-style log messages
       from the comma-separated list of revisions.

  -xblog
       Obtains log messages for file by extracting RCS-style log messages
       from all revisions of file in this branch.

....

  If the -xlog option has been specified, an attempt is made to obtain the
  log message from file by extracting all RCS-style log messages from the
  comma-separated list of branches, beginning after a $Log...$ line, and con-
  tinuing up to but not including the first line that does not begin with the
  precise RCS comment leader recorded for the file. Note: be careful with
  white space variants when manually editing such areas - most leaders end
  with a space and the text typically begins with a tab. The comment leader
  portion of each extracted line is stripped off along with any initial tab
  character.  The revision number, date/time, and author revision banner is
  compressed into a date/time and author stamp, which is appended to the end
  of each extracted revision message.

226.2Re: rcs history information...SMURF::FILTERAutomatic Posting Software - mail to flume::puckTue Jul 27 1993 13:5912
Date Of Receipt: 	26-JUL-1993 08:44:54.81
From: 	ALPHA::"[email protected]" "Michael D. Fairbrother UEG  26-Jul-1993 0844"
To: 	"Joshua M. Friedman, OSF/UNIX SDE 381-1548" <[email protected]>
CC: 	[email protected], [email protected], [email protected]
Subj: 	Re: rcs history information...

Not sure how useful these flags are... the -xlog and -xblog (if used)
will create the check in log message,  not provide me with the current
log information for a checked in file.

mdf.