Hi, If one posts a review containing a removed symlink you get "There was an error displaying this diff." when looking at the diff view. This is with reviewboard 2.5.8 and a git repository.
The attached patch reproduces the problem in a unit test. Let me know if you need any more info. Also, it seems like the tags for the just released reviewboard versions aren't pushed to github. // Erik -- Erik Johansson Home Page: http://ejohansson.se/ PGP Key: http://ejohansson.se/erik.asc -- Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/ Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/ Happy user? Let us know! https://www.reviewboard.org/users/ --- You received this message because you are subscribed to the Google Groups "reviewboard" group. To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
diff --git a/reviewboard/diffviewer/tests.py b/reviewboard/diffviewer/tests.py index 9cbfcc1..24d943f 100644 --- a/reviewboard/diffviewer/tests.py +++ b/reviewboard/diffviewer/tests.py @@ -417,6 +417,24 @@ class DiffParserTest(TestCase): with self.assertRaises(Exception): diffutils.patch(diff, old, 'foo.c') + def test_patch_removed_symlink(self): + """Testing diffutils.patch with removed symlink""" + old = b'README' + + new = b'' + + diff = (b'diff --git a/README b/README\n' + b'deleted file mode 120000\n' + b'index c3ca074..0000000\n' + b'--- a/README\n' + b'+++ /dev/null\n' + b'@@ -1 +0,0 @@\n' + b'-README\n' + b'\\ No newline at end of file\n') + + patched = diffutils.patch(diff, old, 'README') + self.assertEqual(patched, new) + def test_empty_patch(self): """Testing diffutils.patch with an empty diff""" old = 'This is a test'