3356: "Diff currently unavailable" when reviewing change to file that is not pushed to remote repo yet

sms****@gmai***** (Google Code) (Is this you? Claim this profile.)
Oct. 30, 2014
What version are you running?

1.7.20 of RB, RBTools 0.5.5, RBTools 0.6

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

http://rb.example.com/r/123/diff/

What steps will reproduce the problem?
1. Create and check in a file with some text foo
2. git mv foo bar
3. commit
4. rbt post
5. edit bar
6. commit
7. rbt post --revision-range=HEAD^:HEAD

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

I expected to see the changes to bar, but instead I get:
Diff currently unavailable.
Error: The file 'bar' (r123abc)  could not be found in the repository.

What operating system are you using? What browser?

rbt was running on a Mac and I'm viewing with Chrome, but I hope these don't matter.

Please provide any additional information below.

The backtrace indicates that RB is trying to fetch a file from the remote repository (in this case, a github instance) but the file is not there. That's expected; the git mv commit has not been pushed yet. rbt post would need to get the base file from the local repository.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/diffviewer/views.py", line 251, in view_diff_fragment
    diff_file = get_requested_diff_file()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/diffviewer/views.py", line 171, in get_requested_diff_file
    populate_diff_chunks(files, highlighting, request=request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 342, in populate_diff_chunks
    chunks = generator.get_chunks()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 137, in get_chunks
    large_data=True)
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.7.27-py2.7.egg/djblets/util/misc.py", line 157, in cache_memoize
    data = lookup_callable()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 136, in <lambda>
    lambda: list(self._get_chunks_uncached()),
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/diffviewer/chunk_generator.py", line 141, in _get_chunks_uncached
    old = get_original_file(self.filediff, self.request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 126, in get_original_file
    request=request)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/scmtools/models.py", line 171, in get_file
    large_data=True)[0]
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.7.27-py2.7.egg/djblets/util/misc.py", line 157, in cache_memoize
    data = lookup_callable()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/scmtools/models.py", line 170, in <lambda>
    request)],
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/scmtools/models.py", line 263, in _get_file_uncached
    base_commit_id=base_commit_id)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.20.dev-py2.7.egg/reviewboard/hostingsvcs/github.py", line 301, in get_file
    raise FileNotFoundError(path, revision)
david
#1 david
The example you gave looks like RBTools 0.5, in which case you may also want to add --parent=HEAD^

With RBTools 0.6, you should be able to run `rbt post HEAD` and it should do the right thing.
  • +UserError
#2 sms****@gmai***** (Google Code) (Is this you? Claim this profile.)
I have just tried with RBTools 0.6. The change is no longer HEAD, but let's call it abc123.

$ rbt post abc123

This gives the same result.

$ rbt post abc123^ abc123

This gives the same result.

$ rbt post --parent=abc123^ abc123

This gives the same result.

Any other suggestions?
david
#3 david
Can you run with --debug and post the output?
  • -UserError
    +NeedInfo
#4 sms****@gmai***** (Google Code) (Is this you? Claim this profile.)
Here we go. Note that def456 is the (only) parent of abc123, and ghi789 is the commit before the git mv commit. It seems odd to pass --no-renames and -M together.

$ rbt post --debug --parent=abc123^ abc123
>>> RBTools 0.6
>>> Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
>>> Running on Darwin-13.1.0-x86_64-i386-64bit
>>> Home = /Users/foo
>>> Current directory = /Users/foo/repo
>>> Checking for a Subversion repository...
>>> Running: svn info --non-interactive
>>> Command exited with rc 1: ['svn', 'info', '--non-interactive']
svn: E155007: '/Users/foo/repo' is not a working copy
---
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.master.merge
>>> Running: git config --get branch.master.remote
>>> Running: git config --get remote.origin.url
>>> repository info: Path: git@github.example.com:example/project.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to https://rb.example.com/api/
>>> Making HTTP GET request to http://rb.example.com/api/info/
>>> Running: git rev-parse abc123
>>> Running: git rev-parse abc123^
>>> Running: git branch -r --contains def456
>>> Running: git merge-base def456 origin/master
>>> Running: git diff --no-color --full-index --ignore-submodules --no-renames def456..abc123 -M
>>> Running: git diff --no-color --full-index --ignore-submodules --no-renames ghi789..def456 -M
>>> Running: git log --reverse --pretty=format:%s%n%n%b ^ghi789 abc123
>>> Making HTTP GET request to http://rb.example.com/api/review-requests/
>>> Making HTTP POST request to http://rb.example.com/api/review-requests/
>>> Making HTTP GET request to http://rb.example.com/api/review-requests/123/diffs/
>>> Making HTTP POST request to http://rb.example.com/api/review-requests/123/diffs/
>>> Making HTTP GET request to http://rb.example.com/api/review-requests/123/draft/
>>> Making HTTP PUT request to http://rb.example.com/api/review-requests/123/draft/
Review request #123 posted.

http://rb.example.com/r/123/
http://rb.example.com/r/123/diff/
david
#5 david
So the diffs there look correct--it's generating a diff between def456 and abc123 (the one that gets shown), and then a parent diff between ghi789 and def456. Can you look in the database and verify that the parent diff is present?

I'll fix the --no-renames nonsense in another change.
#6 sms****@gmai***** (Google Code) (Is this you? Claim this profile.)
Sorry, I don't have access to the database.
david
#7 david
Without deeper info, I don't think we can make any more progress on this. Posting changes with parent diffs is quite well tested, especially with the new syntax in rbtools 0.6, so I think it's probably some user error somewhere.
  • -NeedInfo
    +UserError