Search code examples
svnrevision-history

Get the svn revision less than a given number?


I am using windows OS only. I need a command to get the last revision which is less than or equal to a given revision number. Eg. latest rev = 300. The other revs = 290, 289, 280 etc. If i search for <= 285, then I should get 280 only. Is there a command for this ?

I googled and found no answer. One solution might be to use svn log --limit 100 http://svn.repo1.com/trunk/app. Hopefully, the required number lies within the last 100 revisions, otherwise I will get no results. Then, parse through each of the 100 results, extract only the revision number while discarding all the presentation, comments etc. Then, look for the desired number in a list of 100 numbers. But, this is a very inefficient way. Please suggest something quick and easy.


Solution

  • svn log http://your_repo/subdirectory/file -r 285:0 -l 1
    

    will output the log for the first (-l 1) revision that affected subdirectory/file when counting from commit 185 backwards to the first commit (-r 285:0).