What version are you running?
1.6.3
What's the URL of the page containing the problem?
http://[host]/r/[id]/diff/#index_
What steps will reproduce the problem?
1. clone upstream mercurial repository
2. add a commit, but don't push it
3. do 'hg postreview tip'
4. try to 'View Diff' on the draft review page
What is the expected output? What do you see instead?
Expected to see API reject the patch mentioning non-existent commit (it's not in upstream, remember?) and, thus, expected postreview to fail.
But instead postreview is successful, but diff page shows a trace saying it can't apply the patch
What operating system are you using? What browser?
Debian Linux, Iceweasel (a.k.a Firefox)
Please provide any additional information below.
Basically, the that newly created commit isn't present in upstream and thus reviewboard cannot properly fetch 'raw-file/NEW_REVISION/path/to/file'. That's OK, given the fact that it's _my_ error to post a review for a commit not present in upstream. But here's the glitch: somewhere under the hood an arbitrary file is actually fetched, but it's not the expected file and patching fails.
I've traced the source to HgWebClient.cat_file('path/to/file', rev=>'NEW_REVISION'), which succeeds and instead of the requested file or HTTP404 returns a summary page, which is wrong.
The loop
for rawpath in ["raw-file", "raw"]:
full_url = ''
returns proper HTTP404 for "raw-file" iteration, but for "raw" it succeeds and return contents of a summary web-page.