Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3573 by sararayb...@gmail.com: Git style mercurial diffs with file renames don't work
https://code.google.com/p/reviewboard/issues/detail?id=3573

What version are you running?
RB 2.0.7

What's the URL of the page containing the problem?
http://reviewboard.cctechnol.com/r/4112/diff/#

What steps will reproduce the problem?
1. 'hg rename file1 file2'
2. 'hg diff -g > rename.patch
3. Create new review request with rename.patch
4. View diff

What is the expected output? What do you see instead?
Expected output is a diff view that only shows the renames (note that the problem also exists with diffs with changes to the renamed files). Actual output in diff summary box shows rename correctly, but diff viewer says revision UNKNOWN with a traceback. See end of bug report for traceback and very simple diffs to recreate the problem.

What operating system are you using? What browser?
Fedora 19, 20, CentOS 6. Firefox 30 & Chrome

Please provide any additional information below.

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/views.py", line 236, in get
    renderer = self.create_renderer(context, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/reviews/views.py", line 1088, in create_renderer
    *args, **kwargs)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/views.py", line 328, in create_renderer
    self.diff_file = self._get_requested_diff_file()
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/views.py", line 369, in _get_requested_diff_file
    request=self.request)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 383, in populate_diff_chunks
    chunks = generator.get_chunks()
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 153, in get_chunks
    large_data=True)
File "/usr/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/cache/backend.py", line 111, in cache_memoize
    data = lookup_callable()
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 152, in <lambda>
    lambda: list(self._get_chunks_uncached()),
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 159, in _get_chunks_uncached
    old = get_original_file(self.filediff, self.request, encoding_list)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 169, in get_original_file
    request=request)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/scmtools/models.py", line 291, in get_file
    large_data=True)[0]
File "/usr/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/cache/backend.py", line 111, in cache_memoize
    data = lookup_callable()
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/scmtools/models.py", line 290, in <lambda>
    request)],
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/scmtools/models.py", line 456, in _get_file_uncached
    data = self.get_scmtool().get_file(path, revision)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/scmtools/hg.py", line 43, in get_file
    return self.client.cat_file(path, six.text_type(revision))
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/scmtools/hg.py", line 264, in cat_file
    raise FileNotFoundError(path, rev)
FileNotFoundError: The file 'include/CCvideo/configUI.H' (rUNKNOWN) could not be found in the repository

Diffs to Recreate Issue (I couldn't attach due to "Issue attachment storage quota exceeded")

1) Create repo called "testRepo"
2) Import initialCommit.patch
3) Add to review board
4) Create new review request with rename.patch
5) View diff

initialCommit.patch:

exporting patch:
# HG changeset patch
# User Sara Rayburn <serayb...@cctechnol.com
# Date 1411131866 18000
#      Fri Sep 19 08:04:26 2014 -0500
# Node ID f556efc41e9c64befad75cba2d008cb5bf8f52f0
# Parent  0000000000000000000000000000000000000000
Initial commit

diff -r 000000000000 -r f556efc41e9c testFile1.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/testFile1.txt     Fri Sep 19 08:04:26 2014 -0500
@@ -0,0 +1,1 @@
+Some text

rename.patch:

diff --git a/testFile1.txt b/testFile2.txt
rename from testFile1.txt
rename to testFile2.txt




--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to