Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!ctrsol!ginosko!uunet!mitel!sce!nrcaer!dciem!array!len From: len@array.UUCP (Leonard Vanek) Newsgroups: comp.software-eng Subject: Re: Does anyone have tools for use with RCS that they can share? Keywords: RCS report awk shell script Message-ID: <49@array.UUCP> Date: 4 Aug 89 13:43:43 GMT References: <342@capmkt.COM> Reply-To: len@array.UUCP (Leonard Vanek) Organization: Array Systems Computing, Inc., Toronto, Ontario, CANADA Lines: 103 In article <342@capmkt.COM> brent@capmkt.COM (Brent Chapman) writes: >It seems to me that many people and organizations, over the past few >years, must have written tools to augment and compliment RCS. If you >have, I urge you to consider sharing your tools with the rest of us, >before we all go out and "reinvent the wheel". Things I'm particularly >interested in include, but aren't necessarily limited to, the following: > > + A report of files in a source tree that are currently checked out, > by who, and since when. > > + A report of files in a source tree that have not yet been placed > under RCS control. > > + Tools for creating, managing, and using "S-lists", or lists of the > various components (and the version of each of those components) in > a given product. > The following shell/awk script partially satisifies your first request. To get what you want you would have to modify the awk script to skip records containing a null "locked by" field. Actually, I would do this by passing it through awk twice, the first time as shown below (which reduces each file to a single record) and then another pass to select the records of interest. With shell and awk scripts it is possible to produce lots of interesting reports, such as a tabular revision history for a single file or a list sorted by latest revision date. I have also included shell scripts for these. Of course, these tools can only produce what is already present in the RCS files, so they cannot help in your second request and I am not sure about the third one. Perhaps using special naming conventions can encode what you want in the RCS files, so that a script can be used to produce the desired report. --------------------------- cut here ------------------------------ #! /bin/sh # Tabular list of RCS files # Usage: trlst path_to_project_library # rlog /usr2/YOUR_BASE_PATH/$1/RCS/*,v | awk '\ BEGIN {print "\n Configuration Listing\n";\ print "file name revision locked by date and time revised";\ print "--------- -------- --------- ---------------------"}\ /RCS file:/ {printf "%-16s ", $6; flag = 0}\ /^head:/ {printf "%6s ", $2}\ /^locks:/ {if ($2==";") $2=" "; printf "%-9s ", $2}\ /^date:/ {if (flag==0) {\ printf " %-s %-s\n", $2, substr($3,1,8);\ flag = 1\ } } END {print " "}' --------------------------- cut here ------------------------------ #! /bin/sh # Tabular list of RCS files sorted by last modification date # Usage: traged path_to_project_library # echo echo " Configuration Listing by Date and Time" echo echo "file name revision locked by date and time revised" echo "--------- -------- --------- ---------------------"; rlog /usr2/YOUR_BASE_PATH/$1/RCS/*,v | awk '\ /RCS file:/ {printf "%-16s ", $6; flag = 0}\ /^head:/ {printf "%6s ", $2}\ /^locks:/ {if ($2==";") $2=" "; printf "%-9s ", $2}\ /^date:/ {if (flag==0) {\ printf " %-s %-s\n", $2, substr($3,1,8);\ flag = 1\ } }' | sort +0.36 echo --------------------------- cut here ------------------------------ #! /bin/sh # Tabular revision history of a single RCS file # Usage: trhist filename path_to_project_library # echo echo Revision history summary of $1 echo rlog /usr2/YOUR_BASE_PATH/$2/RCS/$1,v | awk '\ /^description:/ {flag=1; next} {if (flag==1) {print;\ printf "\n";\ printf "revision date time who description\n";\ printf "-------- -------- -------- ----- -----------\n";\ flag=0}\ }\ /^revision / {printf "%-6s ", $2}\ /^date: / {printf "%4s %4s %-6s ", $2, substr($3,1,8), $5; flag=2; next}\ {if (flag==2) {printf "%-40s\n", substr($0,1,40);\ printf "%34s%-40s\n", " ", substr($0,41,40); flag=0}\ }' --------------------------- cut here ------------------------------ Leonard Vanek UUCP: ... uunet!attcan!lsuc!array!len Array Systems Computing Inc. or ... utzoo!dciem!array!len 5000 Dufferin St. Suite 200 or lsuc!array!len@ai.toronto.edu Downsview, Ont. M3H 5T5 Phone: (416) 736-0900 Canada FAX: (416) 736-4715