[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checkout a file revision to stdout?

From: Todd Denniston
Subject: Re: Checkout a file revision to stdout?
Date: Tue, 16 Mar 2004 08:10:33 -0500

address@hidden wrote:
> Is there any way to checkout a specific revision of a file to standard
> output, rather than creating a file?
> The real reason for wanting to do this is to find which revision of a
> file a particular piece of text first appeared.
> I wrote a script called rcsgrep a long time ago that checked out files
> on the main trunk only directly from the ,v file in the archive, and
> grepped through each one in turn.  So I could use that.  I just
> wondered if there was a better way.

if it is a line that was put in and never modified, then  `cvs annotate 
filename` might be useful. I have found that command to be a lot of fun.

I usually do something like: 
#say I have 15 revs in the file on the trunk
SEARCH_STRING="old address, from"
for i in `seq $BOTTOM_BOUND $TOP_BOUND`;do \
echo $i; \
cvs diff -u -r1.$BOTTOM_BOUND -r1.$i filename|grep "$SEARCH_STRING" \

If you want it to bail after the first found rev then do an
`if cvs diff....|grep...
exit 0
instead of just the cvs diff line.

> luke

Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane) 
Harnessing the Power of Technology for the Warfighter

reply via email to

[Prev in Thread] Current Thread [Next in Thread]