Add support for finding SVN repository to post-review

Review Request #351 — Created April 6, 2008 and submitted — Latest diff uploaded

Information

Review Board SVN (deprecated)
trunk
451

Reviewers

The patch resolves the problem described in this thread:
http://groups.google.com/group/reviewboard/browse_thread/thread/c9027e1c73cb0c86

Specifically, users can have many different URLs for the same subversion repository, none of which may match the URL that Review Board uses.  There may be differences in hostnames (is it "svn" or "svn.scm" or "svn.scm.example.com") or even more drastic changes in URLs.  For example, a user could have the repository NFS mounted, in which case she'd have a URL like "file:///mnt/svn/repos/").

This patch uses the JSON "get repository info" API (committed as r1263).  If the local repository is Subversion, we loop through each repository on the server.  First we try to find one that has the same UUID.  If we get that, we check to make sure our local checkout's directory is somewhere beneath the repository URL specified on the server.  If it is, we calculate the new base_path for our diff which is relative to the server's URL and send that up with our diff.

This magic won't work if the server uses DOS '\' delimited paths, but it won't be any worse in that case either... it will just revert to the old behaviour.  And I think that is probably a rare use case anyway (most people will use 'http' URLs).
I posted many review drafts with varying local repository URLs and server URLs.
    Loading...