Support extra revision string for svn diff

Review Request #3749 — Created Jan. 16, 2013 and submitted — Latest diff uploaded

Information

t2y
Review Board

Reviewers

Parsing revision number in Subversion is only supported in English environment.

$ svn diff  # LANG=C
Index: dir1/test1.txt
===================================================================
--- dir1/test1.txt	(revision 3)
+++ dir1/test1.txt	(working copy)

For example, these diff header is localized in Japanese environment as follows.

$ svn diff  # LANG=ja_JP.UTF-8
Index: dir1/test1.txt
===================================
--- dir1/test1.txt	(????? 3)
+++ dir1/test1.txt	(?????)

SVNTool.parse_diff_revision() function cannot parse such as localized revision number, because its regular expression doesn't match.
I added an additional "revision_str" item in Advanced Settings for Repository so that it can be passed for the regular expression.

Could you review it?
I welcome any comments from you!
$ ./reviewboard/manage.py test -- reviewboard.scmtools.tests:SubversionTests

Creating test database for alias 'default'...
Testing parsing SVN diff with binary file ... ok
Testing SVNTool.get_file ... ok
Testing basic SVNTool API ... ok
Testing parsing SVN diff with keywords ... ok
Testing revision number parsing ... ok
Testing a SSH-backed Subversion repository ... SKIP: Cannot perform SSH access tests. The local user's SSH public key must be in the /Users/t2y/.ssh/authorized_keys file and SSH must be enabled.
Testing a SSH-backed Subversion repository with a LocalSite ... SKIP: Cannot perform SSH access tests. The local user's SSH public key must be in the /Users/t2y/.ssh/authorized_keys file and SSH must be enabled.
Testing parsing SVN 1.6 diff with property changes ... ok
Testing parsing SVN 1.7+ diff with property changes ... ok
Testing parsing SVN diff with unterminated keywords ... ok

----------------------------------------------------------------------
Ran 10 tests in 3.082s

OK (SKIP=2)
Destroying test database for alias 'default'...

    Loading...