4374: Support SVN 1.9.x 'nonexistent' for new files when relocation info is present.

4392, 4421

What version are you running?

ReviewBoard v2.5.3, SVN 1.9.3

What's the URL of the page containing the problem?


What steps will reproduce the problem?

  1. Create a branch of an existing folder: svn copy integration/ bug-branch/
  2. Add (and commit) a file to the branch: svn add bug-branch/new-file.txt
  3. Diff the two branches: svn diff integration/ bug-branch/
  4. Upload the diff as a new revision.

What is the expected output? What do you see instead?

A new review is created with a diff showing a new file was created. Instead get an error that the diff file could not be parsed near '(.../integration) (nonexistent)'

What operating system are you using? What browser?

Ubuntu 12.04 LTS / Google Chrome (latest).

Please provide any additional information below.

Found in https://reviews.reviewboard.org/r/7617 that the new 'nonexistent' terminology used by SVN 1.9.x was supported, but we were still seeing errors refering to it. Found it only occurs when feeding diffs of branches with new files, such as this diff fragment:

Index: ChangeLog.txt

--- ChangeLog.txt (.../integration) (nonexistent)
+++ ChangeLog.txt (.../bug-branch) (revision 11779)
@@ -0,0 +1,7 @@

A quick look at reviewboard/scmtools/svn/__init__.py found that the nonexistent regexp did not support this "relocation information" like the general revision regexp did. A quick patch (attached) appears to fix the problem but only did trivial testing. Hopefully this is enough info for a developer to take and fix this corner case. Thanks!

--- /srv/revboard/lib/python2.7/site-packages/ReviewBoard-2.5.3-py2.7.egg/reviewboard/scmtools/svn/__init__.py.old	2016-03-21 17:13:41.579625435 -0600
+++ /srv/revboard/lib/python2.7/site-packages/ReviewBoard-2.5.3-py2.7.egg/reviewboard/scmtools/svn/__init__.py	2016-03-21 17:02:59.876780598 -0600
@@ -118,7 +118,16 @@
         # Starting with 1.9, Subversion returns (nonexistent) instead of
         # (revision 0) for newly added files.
         self.nonexistent_re = re.compile(r'''
-            ^\((?:
+            ^(\(([^\)]+)\)\s)?      # creating diffs between two branches of a
+                                    # remote repository will insert extra
+                                    # "relocation information" into the diff.
+            (?:\d+-\d+-\d+\ +       # svnlook-style diffs contain a timestamp
+               \d+:\d+:\d+\ +       # on each line before the revision number.
+               [A-Z]+\ +)?          # This here is probably a really crappy
#1 david

Can you please post your patch on https://reviews.reviewboard.org/ ? Thanks!

#2 ryank-inovonics

Looks like I need to generate a git diff to post the patch, what I have is just a file diff from our installed instance. Will see if I can get the git diff generated and uploaded this weekend.

#3 ryank-inovonics

Submitted my patch, slightly tweaked, at: https://reviews.reviewboard.org/r/8187/

#5 brennie

This should be fixed on release-2.0.x as commit 33081fbde380c7ebf61c6f4a80138be975b33496.

  • -New