Support extra revision string for svn diff
Review Request #3749 — Created Jan. 16, 2013 and submitted
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'...
Description | From | Last Updated |
---|---|---|
Col: 34 E231 missing whitespace after ',' |
reviewbot | |
Col: 29 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 53 E231 missing whitespace after ',' |
reviewbot | |
Col: 53 E231 missing whitespace after ',' |
reviewbot | |
Col: 53 E231 missing whitespace after ',' |
reviewbot |
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/tests.py reviewboard/scmtools/admin.py reviewboard/scmtools/models.py reviewboard/scmtools/svn.py Ignored Files:
-
I don't think that putting this in the database is quite the right solution, because it's just a small incremental improvement which still forces everyone to use the same locale. Different users may be using different locales, especially in globally distributed teams. What I'd prefer to see is just improving our existing regular expression to cope with the different localized revision strings that svn might produce. Note that if you use post-review to create your diffs, it will already handle this problem by ensuring that svn is always run in the C locale.
T2
- Change Summary:
-
I investigated the localized revision string in subversion-trunk. The result is grep_revision-workingcopy_from_pofile.log file. I improved my patch to include these different revision strings for the regular expression. Could you re-review it!
- Testing Done:
-
~ I made the "test_extra_revision_str_parsing" for my changes.
~ $ ./reviewboard/manage.py test -- reviewboard.scmtools.tests:SubversionTests
~ $ ./reviewboard/manage.py test -- reviewboard.scmtools.tests:SubversionTests
~ Creating test database for alias 'default'...
- Creating test database for alias 'default'... Testing parsing SVN diff with binary file ... ok - Testing revision number parsing with extra revision_str ... 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 11 tests in 1.304s
~ Ran 10 tests in 3.082s
OK (SKIP=2)
Destroying test database for alias 'default'... - Added Files: