Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-18 Thread Christian Hammond
Sorry, we can't get you an early patch for this just yet. We'd have to do some research and testing, and right now we're swamped with work for some of our premium support customers. However, if your team wants to investigate this and write a patch, we can review it on

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-18 Thread Wesly Chen
OK, we did some patch for our own ReviewBoard-2.0.20-py2.6.egg/reviewboard/scmtools/cvs.py 185a186,188 > def normalize_path_for_display(self, filename): > return re.sub(",v$", "", filename) > Basically, we add the following two lines after line 186 in

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-18 Thread Christian Hammond
How are you generating the diffs? I noticed that as well, and I don't believe it should be showing the ",v". Christian -- Christian Hammond - christ...@beanbaginc.com Review Board - https://www.reviewboard.org Beanbag, Inc. - https://www.beanbaginc.com On Wed, Nov 18, 2015 at 2:25 PM, Wesly

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-18 Thread Wesly Chen
In the error message, 2015-11-18 01:34:33,409 - ERROR - - Failed to apply pygments: no lexer for filename u'/home/cvs/OPS/nagios/libexec/check_mysql_multirow.pl,v' found Review Board might need to add a filename check for CVS repository and remove the trailing ",v" then pass the filename

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-18 Thread Wesly Chen
Besides, the path in log /home/cvs/OPS/nagios/libexec/check_mysql_multirow.pl ,v is the path on CVS repository server filesystem. My local path is (on different host)

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-18 Thread Wesly Chen
It seems to be related to CVS repository. In CVS repository, all the file will be trailed with ",v" and the content of CVS files are not similar with original one. However, "cvs diff" can parse and generate the diff file. So the review board Diff Viewer should check and parse the lexer based on

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-18 Thread Wesly Chen
Using "rbt post", full command as following: -- rbt post -u -r 114 -I check_mysql_multirow.pl And the rbt post reference my ~/.reviewboardrc setting REPOSITORY = "CVS-prod" which is defined in reviewboard. rbt is using the local "cvs" command to generate the diff. Christian

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-17 Thread Wesly Chen
I modified -- markup_b = self._apply_pygments(new or '', dest_file) except: pass to markup_b = self._apply_pygments(new or '', dest_file) except Exception as e: logging.exception('Failed to apply pygments: %s', e)

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-17 Thread Christian Hammond
Okay, you'll have to add 'import logging' to the line above the logging statement. Christian -- Christian Hammond - christ...@beanbaginc.com Review Board - https://www.reviewboard.org Beanbag, Inc. - https://www.beanbaginc.com On Tue, Nov 17, 2015 at 5:09 PM, Wesly Chen

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-17 Thread Wesly Chen
2015-11-18 01:34:33,284 - DEBUG - None - wchen - /reviews/r/114/diff/3/fragment/1876/ - Patching file check_mysql_multirow.pl took 0.042870 seconds 2015-11-18 01:34:33,409 - ERROR - - Failed to apply pygments: no lexer for filename u'/home/cvs/OPS/nagios/libexec/check_mysql_multirow.pl,v'

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-17 Thread Christian Hammond
They're part of the site_siteconfiguration table, but if it's showing as checked, then that's fine. The issue you're hitting has not come up before, that I've seen, so I expect it's something internal. In that code block you pasted, there's this: try: # TODO: Try to figure out the

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-15 Thread Christian Hammond
Right. What were you looking to do with this file? Are you comfortable debugging Python web applications? Christian -- Christian Hammond - christ...@beanbaginc.com Review Board - https://www.reviewboard.org Beanbag, Inc. - https://www.beanbaginc.com On Sat, Nov 14, 2015 at 11:50 PM, Wesly Chen

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-15 Thread Wesly Chen
I can try. Could you tell me where are the following settings in MySQL database "reviewboard" so I can verify the setting is enabled in MySQL or not. 1. System setting => Diff Viewer settings => Show syntax highlighting is checked. 2. Account settings " Enable syntax highlighting in the diff

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Christian Hammond
I'll need that information to be able to diagnose the issue. As it is, I have no insight into what could be going wrong, and would have to run tests here. Christian -- Christian Hammond - christ...@beanbaginc.com Review Board - https://www.reviewboard.org Beanbag, Inc. -

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Christian Hammond
Can you check if there's anything in the logs? Do you have a file you can send that reproduces the problem? Christian -- Christian Hammond - christ...@beanbaginc.com Review Board - https://www.reviewboard.org Beanbag, Inc. - https://www.beanbaginc.com On Sat, Nov 14, 2015 at 3:28 PM, Wesly

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
All the diff upload by "rbt post" doesn't show syntax highlight in Diff Viewer. However, "syntax highlighting" with attached file (java), just not in Diff Viewer. Christian Hammond於 2015年11月14日星期六 UTC-8下午10時25分20秒寫道: > > Can you check if there's anything in the logs? > > Do you have a file you

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
I uploaded portion of the java file as the screenshot show. We use CVS as repository. Christian Hammond於 2015年11月14日星期六 UTC-8下午10時50分48秒寫道: > > I'll need that information to be able to diagnose the issue. As it is, I > have no insight into what could be going wrong, and would have to run tests

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Christian Hammond
It's in reviewboard/diffviewer/diffutils.py. Look for apply_pygments. Christian -- Christian Hammond - christ...@beanbaginc.com Review Board - https://www.reviewboard.org Beanbag, Inc. - https://www.beanbaginc.com On Sat, Nov 14, 2015 at 11:35 PM, Wesly Chen wrote: >

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
I tried to upgrade to 2.5.11 and failed (at another thread), Here is my log (reviewboard.log), no error. 2015-11-15 07:22:07,902 - DEBUG - None - wchen - /reviews/r/114/diff/3/fragment/1876/ - Begin: Fetching file '/home/cvs/OPS/nagios/libexec/check_mysql_rows.pl,v' r1.1 from CVS-prod

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Christian Hammond
There's no file or configuration to check. This stuff is built to work in Review Board. The only option I can offer right now is to check a file that's having problems on our end to see if it's a regression in Review Board. Christian -- Christian Hammond - christ...@beanbaginc.com Review Board

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Christian Hammond
We use Pygments for syntax highlighting. We changed how we do syntax highlighting in 2.5, and it may have an issue with your files. Christian -- Christian Hammond - christ...@beanbaginc.com Review Board - https://www.reviewboard.org Beanbag, Inc. - https://www.beanbaginc.com On Sat, Nov 14,

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
Which python modules or libraries are used for syntax highlighting? I would like to check those modules or libraries to see if some configuration run or file corruption. Christian Hammond於 2015年11月14日星期六 UTC-8下午10時25分20秒寫道: > > Can you check if there's anything in the logs? > > Do you have a

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
Here is the python modules on the system. Which file I should check for the configuration? I'm not familiar with python. # ls -lg /usr/lib/python2.6/site-packages/*ygment* /usr/lib/python2.6/site-packages/pygments: total 1080 -rw-r--r-- 1 root 13055 Sep 15 2009 cmdline.py -rw-r--r-- 2 root

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Christian Hammond
Thanks, though unfortunately, the middle of a file won't be sufficient to reproduce this. I'm actually going to need the first 50 lines or so of a file, at least. Ideally, an entire file. You could try creating a dummy file to add to a review request, see if it's still failing, and then you could

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
Could you point out which python files under /usr/lib/python2.6/site-packages/ReviewBoard-2.0.20-py2.6.egg/reviewboard/ is showing the syntax highlighting in Diff Viewer? Thanks, Wesly Christian Hammond於 2015年11月14日星期六 UTC-8下午11時09分49秒寫道: > > There's no file or configuration to check. This

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Christian Hammond
For some reason I had thought you were using Review Board 2.5, I think because of the other support e-mails. So it's not a regression after all. Can you check the Review Board log file, see if there are any errors when viewing a review request? Christian -- Christian Hammond -

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
On my review board system, it is in /usr/lib/python2.6/site-packages/ReviewBoard-2.0.20-py2.6.egg/reviewboard/diffviewer/chunk_generator.py (not in diffutils.py) --- (started with line 219) if self._get_enable_syntax_highlighting(old, new, a, b): repository =

Re: Syntax highlighting in Diff Viewer doesn't work after upgrade from 1.7.27 to 2.0.20

2015-11-14 Thread Wesly Chen
Here is some python package information # ls -1 /usr/lib/python2.6/site-packages/ argparse-1.2.1-py2.6.egg-info argparse.py argparse.pyc argparse.pyo asciidocapi.py asciidocapi.pyc asciidocapi.pyo dateutil dbus dbus_bindings.py dbus_bindings.pyc dbus_bindings.pyo

Re: Syntax highlighting for Template toolkit (.tt file format) in ReviewBoard is incorrect

2015-10-26 Thread Christian Hammond
Hi, We use a third-party library, Pygments, for syntax highlighting. It appears to have no knowledge of Perl Template Toolkit files, and thinks *.tt files are Treetop files. We have some new logic coming in 2.0.21 and 2.5, which will be smarter about what type of file it's processing, but the

Re: Syntax highlighting

2010-04-21 Thread Dan Savilonis
I've added support for changing the syntax highlighting scheme, if that will help with your disappointment in the highlighting. It's working, but it needs some better integration for installation. Right now you have to hack up the pygments generated styles with a script.

Re: Syntax highlighting

2010-04-21 Thread Christian Hammond
We used to use get_lexer and saw some serious performance problems with it, which is why we switched to get_lexer_for_filename. Christian -- Christian Hammond - chip...@chipx86.com Review Board - http://www.reviewboard.org VMware, Inc. - http://www.vmware.com On Wed, Apr 21, 2010 at 8:45 AM,

Re: Syntax highlighting

2010-04-21 Thread Tim Hollingsworth
Thanks for the response, I'll take a look at pygment and try out your fix Dan. On Wed, Apr 21, 2010 at 12:17 PM, Christian Hammond chip...@chipx86.comwrote: We used to use get_lexer and saw some serious performance problems with it, which is why we switched to get_lexer_for_filename.

Re: Syntax highlighting

2010-04-21 Thread Dan Savilonis
That's what I thought. But I'm sure we can come up with some solution. Presumably we only have to have a one-time performance penalty per file, if we're intelligent about it. Also, have you considered any alternatives to pygments? Dan On Apr 21, 3:17 pm, Christian Hammond chip...@chipx86.com

Re: Syntax highlighting

2010-04-20 Thread Christian Hammond
Hi Tim, We use a Python module called Pygments (http://www.pygments.org/) for the syntax highlighting, so we basically support whatever they do. The lack of Obj-C highlighting is certainly an annoyance that I've dealt with too. It's due to Pygments giving preference to I think Matlab files or

Re: Syntax highlighting

2009-06-16 Thread MStruzak
Ok, here is the diff to be applied to ReviewBoard-1.0rc3-py2.5.egg/ reviewboard/diffviewer/diffutils.py: --- diffutils.py2009/06/16 21:37:54 1.1 +++ diffutils.py2009/06/16 21:58:24 @@ -9,6 +9,7 @@ try: import pygments from pygments.lexers import

Re: Syntax highlighting

2009-06-15 Thread Christian Hammond
Hi Marcin, There's no setting for this yet, but I know someone was working on one. It's too late to get it into 1.0, but it's possible we can encourage him to get it ready for 1.1 :) This is really an issue in Pygments, the third-party library we use for syntax highlighting. They hard-code the