2556: rUNKNOWN error: ssh based mercurial repositories

mail*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Sept. 4, 2012
Configure a ssh based mercurial repo with reviewboard. Submit a review request by changing an existing file.

The file 'README' (rUNKNOWN) could not be found in the repository: 'sshrepository' object has no attribute 'changectx'
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.6.4.1-py2.7.egg/reviewboard/diffviewer/views.py", line 151, in view_diff
    interdiffset, highlighting, True)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.6.4.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 1072, in get_diff_files
    large_data=True)
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.6.16-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.6.4.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 1071, in <lambda>
    enable_syntax_highlighting)),
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.6.4.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 552, in get_chunks
    old = get_original_file(filediff)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.6.4.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 365, in get_original_file
    large_data=True)[0]
  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.6.16-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.6.4.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 364, in <lambda>
    data = cache_memoize(key, lambda: [fetch_file(file, revision)],
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.6.4.1-py2.7.egg/reviewboard/diffviewer/diffutils.py", line 343, in fetch_file
    data = tool.get_file(file, revision)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.6.4.1-py2.7.egg/reviewboard/scmtools/hg.py", line 35, in get_file
    return self.client.cat_file(path, str(revision))
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.6.4.1-py2.7.egg/reviewboard/scmtools/hg.py", line 239, in cat_file
    raise FileNotFoundError(path, rev, str(e))
FileNotFoundError: The file 'README' (rUNKNOWN) could not be found in the repository: 'sshrepository' object has no attribute 'changectx'


Logs:
2012-03-28 16:24:39,755 - DEBUG - Using rbssh for mercurial
2012-03-28 16:24:40,559 - DEBUG - Using rbssh for mercurial
2012-03-28 16:24:41,192 - DEBUG - Generating diff viewer page for filediff id 9
2012-03-28 16:24:41,195 - DEBUG - Begin: Generating diff file info for diffset id 9
2012-03-28 16:24:41,200 - DEBUG - Using rbssh for mercurial
2012-03-28 16:24:41,890 - DEBUG - End: Generating diff file info for diffset id 9
2012-03-28 16:24:41,891 - DEBUG - Generating diff file info for diffset id 9 took 0.694481 seconds
2012-03-28 16:24:42,059 - DEBUG - Begin: Generating diff file info for diffset id 9, filediff 14
2012-03-28 16:24:42,060 - DEBUG - Using rbssh for mercurial
2012-03-28 16:24:42,743 - INFO - Cache miss for key reviews.nimblestorage.com:diff-sidebyside-hl-14.
2012-03-28 16:24:42,746 - DEBUG - Using rbssh for mercurial
2012-03-28 16:24:43,384 - INFO - Cache miss for key reviews.example.com:ssh%3A//hg%40hg.example.com/dev/gui:README:UNKNOWN.
2012-03-28 16:24:43,385 - DEBUG - Begin: Fetching file 'README' rUNKNOWN from gui
#1 tjw***@gmai***** (Google Code) (Is this you? Claim this profile.)
I had this issue too, albeit with a locally-accessed Mercurial repo (not SSH).

I fixed it by patching reviewboard/scmtools/hg.py as follows (this is v1.6.10):

233c233
<         if rev == HEAD:
---
>         if rev == HEAD or rev == UNKNOWN:


I'm not sure of how I submit an official patch but if the maintainers can verify the above fix and include it in the next release that would be great...
chipx86
#2 chipx86
That doesn't seem like a fix so much as a workaround. The question is, why is the revision UNKNOWN? Did something change in the diff format?

Seeing the diff in question would help a lot. Having a repro case against a public repository somewhere (or the one bundled in the Review Board source tree in scmtools/testdata/hg_repo.bundle) would be preferable.

As far as contributing changes, we review all code on http://reviews.reviewboard.org/. You'd need to make the change in a local Git branch in a clone of our repository, and then upload using post-review.
  • +NeedInfo
  • +Component-SCMTools
#3 tjw***@gmai***** (Google Code) (Is this you? Claim this profile.)
Huh, it seems if you generate the diff with "hg diff --git" you don't get the changeset ID in the diff. If you omit the --git option it works.
david
#4 david
Unfortunately, there's nothing we can do with diffs that don't provide revision information. post-review will do the right thing.
  • -NeedInfo
    +WontFix
#5 jimmy.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Hi, guys, need your support on this same issue, thanks.
I setup ssh based mercurial repo with reviewboard, when i try to upload diff file to RB, it reports error which is same with above one: 'sshrepository' object has no attribute 'changectx'. thank you for your support.