WebSVN is an open source subversion repository browser written in PHP, offering a compelling alternative to the more obtuse ViewVC and the commercial Atlassian Fisheye.
By default, WebSVN does not display line numbers when looking at the contents of a single file (i.e. URL’s containing filedetails.php). Fortunately, this is easily corrected if you enable Geshi syntax highlighting. It’s enabled by default, but double-check the contents of include/config.php, making sure that the line $config->useGeshi(); is present and not commented out.
With that done, open include/svnlook.php and go to line 806, which looks like this:
$this->geshi->set_tab_width($this->repConfig->getExpandTabsBy());
Create a new line and insert the following immediately after it:
$this->geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
Save your changes and reload the file detail view, and Geshi should now display line numbers along the left-hand margin. With this simple change, I use WebSVN to effectively conduct group code reviews.
Note that WebSVN can still choose not to use Geshi if there’s no support for the language in question, in which case there won’t be any line numbers.
Thank you so much for sharing! I will investigate what else Geshi can do! I also wish to use WebSVN for code reviews and collaboration and your tip for displaying line numbers is a big help. Do you have any tips or direction for the following:
Is there a way to make WebSVN display date of commit or last file change?
Is there any way to send a WebSVN URL to a file with line number argument that would take you to the specified line number?
Thanks again,
-Ed