1700: RB fails to get raw output from Mercurial HTTP repo

gordon.m********@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 22, 2012
What version are you running?

1.5 beta 2

What steps will reproduce the problem?
1. Install Review Board on Ubuntu 10.04 LTS or Debian Lenny
2. Configure Mercurial repo with path containing a https URL
3. Post reviews using Mercurial plugin or 'post-review'
4. Go to Review Board and select View Diff

Expected output: the RB diff viewer working properly.

Actual output: 'patch' fails to apply the diff 100% of the time because it is attempting to apply the diff to cooked HTML output from the browseable Mercurial repo.  This completely breaks the diff viewer and renders RB useless.

Traceback (most recent call last): 
  File "/usr/local/lib/python2.6/dist-packages/reviewboard/diffviewer/ 
views.py", line 153, in view_diff 
    interdiffset, highlighting, True) 
  File "/usr/local/lib/python2.6/dist-packages/reviewboard/diffviewer/ 
diffutils.py", line 881, in get_diff_files 
    large_data=True) 
  File "/usr/local/lib/python2.6/dist-packages/djblets/util/misc.py", 
line 166, in cache_memoize 
    data = lookup_callable() 
  File "/usr/local/lib/python2.6/dist-packages/reviewboard/diffviewer/ 
diffutils.py", line 880, in <lambda> 
    enable_syntax_highlighting)), 
  File "/usr/local/lib/python2.6/dist-packages/reviewboard/diffviewer/ 
diffutils.py", line 531, in get_chunks 
    new = get_patched_file(old, filediff) 
  File "/usr/local/lib/python2.6/dist-packages/reviewboard/diffviewer/ 
diffutils.py", line 356, in get_patched_file 
    return patch(filediff.diff, buffer, filediff.dest_file) 
  File "/usr/local/lib/python2.6/dist-packages/reviewboard/diffviewer/ 
diffutils.py", line 224, in patch 
    (filename, tempdir, patch_output)) 
Exception: The patch to 'install.py' didn't apply cleanly. The 
temporary files have been left in '/tmp/reviewboard.9HV3Hs' for 
debugging purposes. 
`patch` returned: patching file /tmp/reviewboard.9HV3Hs/tmpYvMLPF 
Hunk #1 FAILED at 1. 
1 out of 1 hunk FAILED -- saving rejects to file /tmp/reviewboard. 
9HV3Hs/tmpYvMLPF-new.rej 

In this case, 'tmpYvMLPF' contains HTML output from the Mercurial repo, not the raw contents of the file that should be patched.
#1 gordon.m********@gmai***** (Google Code) (Is this you? Claim this profile.)
A workaround for this is to remove the trailing slash from one's HTTP or HTTPS URL to the repo.  Seriously, that's it.

See http://groups.google.com/group/reviewboard/browse_thread/thread/c77abf75ac836fd0
david
#2 david
Sounds like this is a bug in the hg http(s) implementation
  • +ThirdParty