804: Diff viewer dies when a git diff contains removed files

jeff.ham*********@gmai***** (Google Code) (Is this you? Claim this profile.)
May 29, 2011
What's the URL of the page containing the problem?
https://example.com/reviewboard/r/<rnum>/diff/

What steps will reproduce the problem?
1. Remove a file
2. git add -A
3. git diff HEAD

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

I expect to see my diff; instead, I get the following stack trace:

The file '4377b00' could not be found in the repository

Traceback (most recent call last):
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/views.py",
line 86, in view_diff
    files = get_diff_files(diffset, None, interdiffset, highlighting)
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/diffutils.py",
line 659, in get_diff_files
    enable_syntax_highlighting)
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/diffutils.py",
line 578, in generate_files
    large_data=True)
  File
"/usr/lib/python2.5/site-packages/Djblets-0.4.dev_20081231-py2.5.egg/djblets/util/misc.py",
line 142, in cache_memoize
    data = lookup_callable()
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/diffutils.py",
line 577, in <lambda>
    enable_syntax_highlighting),
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/diffutils.py",
line 338, in get_chunks
    old = get_original_file(filediff)
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/diffutils.py",
line 245, in get_original_file
    large_data=True)[0]
  File
"/usr/lib/python2.5/site-packages/Djblets-0.4.dev_20081231-py2.5.egg/djblets/util/misc.py",
line 142, in cache_memoize
    data = lookup_callable()
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/diffutils.py",
line 244, in <lambda>
    data = cache_memoize(key, lambda: [fetch_file(file, revision)],
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/diffviewer/diffutils.py",
line 224, in fetch_file
    data = tool.get_file(file, revision)
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/scmtools/git.py",
line 33, in get_file
    return self.client.cat_file(self._resolve_head(revision, path))
  File
"/usr/lib/python2.5/site-packages/ReviewBoard-0.9.dev_20081231-py2.5.egg/reviewboard/scmtools/git.py",
line 192, in cat_file
    raise FileNotFoundError(commit)
FileNotFoundError: The file '4377b00' could not be found in the repository

What operating system are you using? What browser?

OS X 10.5 FF 3.0

Please provide any additional information below.

This looks a lot like issues #394 (for cvs) and #442 (for svn).
#1 jeff.ham*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Links to the related issues:

CVS: http://code.google.com/p/reviewboard/issues/detail?id=394
SVN: http://code.google.com/p/reviewboard/issues/detail?id=442

Would love to see a fix soon, will do my best to poke into the code when I get a chance.

Thanks,
Jeff
david
#2 david
  • +Component-DiffViewer
    +Component-SCMTools
david
#3 david
This is almost certainly due to the abbreviated commit SHAs. We need the diffs to be generated with --full-index. post-review does this for you.
  • +UserError