Since it doesn't seem to be possible to get the proxy configuration through the svn executable, I resorted to using an embedded Python script. Why Python? Since it has the ConfigParser module, which allows to read/write INI-style files:
if $(command -v svn &> /dev/null) && $(command -v python &> /dev/null) ; then
python - <<END
import ConfigParser, os
config = ConfigParser.ConfigParser()
config.read(os.path.expanduser('~/.subversion/servers'))
if (config.has_section('global')):
proxy_host = ''
proxy_port = ''
proxy_exceptions = ''
if (config.has_option('global', 'http-proxy-host')):
proxy_host = config.get('global', 'http-proxy-host')
if (config.has_option('global', 'http-proxy-port')):
proxy_port = config.get('global', 'http-proxy-port')
if (config.has_option('global', 'http-proxy-exceptions')):
proxy_exceptions = config.get('global', 'http-proxy-exceptions')
print 'http-proxy-host : ' + proxy_host
print 'http-proxy-port : ' + proxy_port
print 'http-proxy-exceptions: ' + proxy_exceptions
END
fi
This code reads the ~/.subversion/servers
file and prints the values. Similar code can be used to change the proxy values.