refactored svn upstream determination