> -----Original Message-----
> From: Hanley, James [mailto:firstname.lastname@example.org]
> Sent: Wednesday, September 20, 2006 11:58 AM
> To: email@example.com
> Subject: svn grep -r2:5 "a_word" filename1 filename2 folder3
> A while back, there was a request for the ability to grep through the
> source tree of subversion.
> The response mentions using blame, but specifically I would like to
> search for (for example) some structure that existed at one point that
> was removed and what version it was removed from.
> The problem is that using svn blame seems to only produce the
> snapshot of a given version. What I want is the last version
> the string
> was seen in.
> If there is a way of doing this without regressing through
> every version
> of a file, I would like to know, and if there is currently no way of
> doing this, I believe it would be a valuable feature to Subversion.
./rev_grep.sh URL[@PEG_REV] regex
The PEG_REV only works in svn 1.4.0 or higher. ('svn log' supports peg
revs in 1.4.0)
svn log -q $URL | perl -ne 'print "$1\n" if /^r(\d+)/' |
while read r
##svn cat -r $r $URL | grep "$REGEX" > /dev/null
BUFFER=`svn cat -r $r $URL | grep "$REGEX"`
if [ $RET -eq 0 ]
echo "Match in revision: $r. Removed in $LAST_REV."
elif [ $RET -ne 1 ]
## grep hit an error
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA624
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Wed Sep 20 18:38:07 2006