Search the file and all its versions of SVN

how (if possible) to find a line in a file, including all its corrections?

The reason for this is that I know that some line was in my foo.bar file somewhere in the past, but has been deleted since then. There are many changes in the file, so manual search takes a lot of time. I need a tool that will download all versions of the foo.bar file and look for my line in each revision.

If possible, it would be great for me to search the directory, not just one file (but also all versions). It's not obligatory.

The only solution I came with is to write a python script to export changes by revision and always read the file and search for the string using find () .

+4
source share
3 answers

This may answer your question: https://groups.google.com/forum/?fromgroups#!topic/subversion-development/dFIFGBzKt9A

Perhaps you can reset diff throughout history (e.g. git) and grep this file. But this requires svn 1.7.

If you do this with your own script, reverting back using svn-diff can be faster (I haven't tried it yet) and save on disk usage.

+1
source

Have you tried this perl script: How to search for all file changes in the SubVersion repository? It searches for files from the svn repository, starting with the most recent revision for arbitrary strings.

+1
source

I also came up with a Python solution

 code = os.system("svn diff <file-name> -r r<n>:r<n+1> | grep <string-to-search>") 

If it matches, code is 0, otherwise 256, which is actually 1. Why system('exit 1') returns 256`

0
source

All Articles