How do I search all revisions of a file in a SubVersion repository?

前端 未结 7 2010
深忆病人
深忆病人 2020-12-08 19:32

I\'d like to grep all revisions of a file for a string. e.g. to find when a function was added or removed.

Is there a \"simple\" way to do this? (i.e.

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 20:32

    This is a command to search for revisions of a file containing a string:

    svn log -l 30 -q FILENAME | grep ^r | cut -d ' ' -f 1 | while read rev; do
        svn cat -$rev FILENAME | grep -c PATTERN && svn info FILENAME@$rev
    done
    

提交回复
热议问题