0

I use particular comments while checking in the sources into my SVN. I would like to retrieve the list of files checked in for that comment. Pls note i do not know the revision number. I only know the comment against which i had checked in.

I'm trying various thing with

svn log --verbose

Please suggest.

Anu
  • 176
  • 1
  • 3
  • 14

2 Answers2

2

If you're using at least Subversion 1.8.0 (and you should be, it was released June 2013), then you can use svn log --search. From the documentation, this command:

Filters log messages to show only those that match the search pattern ARG. Log messages are displayed only if the provided search pattern matches any of the author, date, log message text (unless --quiet is used), or, if the --verbose option is also provided, a changed path.

The command supports * and ? (glob syntax) and character classes ([abc]).

Note that this doesn't perform a real search through the repository, instead it is a filter on the returned log entries. So if you provide a revision range or use --limit, revisions which would otherwise match your search would be omitted.

Patrick Quirk
  • 23,334
  • 2
  • 57
  • 88
0

You can try following script. Input parameter is search word:

#!/bin/sh

searchWord=$1

if [ ! $searchWord ]; then
    echo "Usage ..."
    exit
fi

IFS=$'\n'

commitRecord=''
dumpCommit=false
lineCounter=0



for line in `svn log --verbose`; do
    lineCounter=$((lineCounter + 1))
    commitRecord[$lineCounter]=$line

    if  [ ${line:1:5} == '-----' ]; then
        if $dumpCommit ; then
            echo $line
        fi
        dumpCommit=false

        unset commitRecord
    fi

    if echo $line | grep -qi $searchWord ; then
        for line in ${commitRecord[*]}; do
            echo $line
        done

        dumpCommit=true

        continue
    fi

    if $dumpCommit ; then
        echo $line
    fi

done
Murad Tagirov
  • 776
  • 6
  • 10