What version are you running?
What's the URL of the page containing the problem?
http://reviews-test.adara.com/reviews/r/114/diff/3-4/ (require login)
What steps will reproduce the problem?
- setup CVS repository and pointing to CVS repository when use "rbt post"
- rbt post
What is the expected output? What do you see instead?
Syntax highlighting should work and show in different color for certain keyword, comments in Diff Viewer.
However, it shows only different color for the different lines in Diff Viewer.
In the reviewboard.log, it seems to be related to CVS repository. In CVS repository, all the files will be trailed with ",v" and the content of CVS files are not similar with original one.
Review Board might need to add a filename check for CVS repository and remove the trailing ",v" then pass the filename without ",v" to "_apply_pygments" in reviewboard/diffviewer/chunk_generator.py.
What operating system are you using? What browser?
OS: CentOS 6.5 x86_64
browser: Google chrome
Please provide any additional information below.
more details in this discussion thread
--- reviewboard.log -------
2015-11-18 22:51:22,158 - ERROR - - Failed to apply pygments: no lexer for filename u'/home/cvs/OPS/nagios/libexec/check_mysql_multirow.pl,v' found
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.20-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 231, in _get_chunks_uncached
markup_a = self._apply_pygments(old or '', source_file)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.20-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 654, in _apply_pygments
File "/usr/lib/python2.6/site-packages/Pygments-2.0.2-py2.6.egg/pygments/lexers/init.py", line 149, in get_lexer_for_filename
raise ClassNotFound('no lexer for filename %r found' % _fn)
ClassNotFound: no lexer for filename u'/home/cvs/OPS/nagios/libexec/check_mysql_multirow.pl,v' found
We have a fix.
185a186,188def normalize_path_for_display(self, filename): return re.sub(",v$", "", filename)
Basically, we add the following two lines after line 186 in ReviewBoard-2.0.20-py2.6.egg/reviewboard/scmtools/cvs.pydef normalize_path_for_display(self, filename): return re.sub(",v$", "", filename)
- New + Confirmed
+ Release-2.0.x + Release-2.5.x
+ Component:DiffParser + Component:SCMTools + SCM:CVS
- Confirmed + PendingReview
- chipx86 + david
Fixed in release-2.5.x (f1d9813). This will ship in 2.5.8. Thanks!
- PendingReview + Fixed