You need to add a -l 1 to your command like this:
svn log -l 1 --search="text"
The -l flag is the shorter version of --limit:
--limit (-l) NUM
Shows only the first NUM log messages.
By first NUM log messages it means the first it hits in order from newest -> oldest.
You view some documenation on the svn log command here.
The above doesn't actually work in this case as per @bahrep's answer however as this doesn't appear to be possible using svn.exe only. I have created a python script that does it:
import xml.etree.ElementTree as ET
import subprocess
import sys
# Change the below to your url and search string
url = "http://svn.apache.org/repos/asf/spamassassin/trunk"
search_term = "160"
# Run the svn log command and get the results as xml
args = ["svn", "log",'--search="{0}"'.format(search_term), url, "--xml"]
svn_out = subprocess.check_output(" ".join(args))
svn_xml = ET.fromstring(svn_out)
try:
# Get the latest log by revision number
latest_log = max(svn_xml, key=lambda x : int(x.attrib["revision"]))
except ValueError:
sys.exit("No Results Found") # Empty svn_xml would indicate no results.
# Print log author and message
author = latest_log.find("author").text
msg = latest_log.find("msg").text
print "{0} : {1}".format(author, msg)
Which returns for me using python 2.7 in Windows:
python .\svn_redemption.py
spamassassin_role : updated scores for revision 1607021 active rules added since last mass-check
Basically it gets the xml results from the the command line output, then gets the highest revision as the result.
You'll need to change the url and the search_term variables to the ones you want, but it should work.