How can you connect OpenGrok to a SVN repository?
Asked Answered
D

1

8

I was able to install and use opengrok on WinXP using this blog entry

http://theflashesofinsight.wordpress.com/2009/05/11/install-opengrok-on-windows/

I now want to index a subversion repository. I checked out a repository to the source folder and can search the files. However the links for history and annotate are not active.

I have svn installed and indexing the directory give no warnings or errors. (There was an error when I didnt have the SVN client installed)

Is there some configuration needed? I saw this link http://blogs.oracle.com/trond/entry/using_subversion_with_opengrok but it did not give me any clue.

I used

java -Xmx1024m -jar opengrok.jar -W  "C:\\OpenGrok\\data\\configuration.xml" -r on -P -S -v -s "C:\\OpenGrok\\source" -d  "C:\\OpenGrok\\data"

and after it

java -Xmx1024m -jar opengrok.jar -R "C:\\OpenGrok\\data\\configuration.xml" -H

This is the resulting config:

<?xml version="1.0" encoding="UTF-8"?> 
<java version="1.6.0_20" class="java.beans.XMLDecoder"> 
 <object class="org.opensolaris.opengrok.configuration.Configuration"> 
  <void property="dataRoot"> 
   <string>C:\OpenGrok\data</string> 
  </void> 
  <void property="projects"> 
   <void method="add"> 
    <object class="org.opensolaris.opengrok.configuration.Project"> 
     <void property="description"> 
      <string>Configuration</string> 
     </void> 
     <void property="path"> 
      <string>/Configuration</string> 
     </void> 
    </object> 
   </void> 
   <void method="add"> 
    <object class="org.opensolaris.opengrok.configuration.Project"> 
     <void property="description"> 
      <string>test</string> 
     </void> 
     <void property="path"> 
      <string>/test</string> 
     </void> 
    </object> 
   </void> 
  </void> 
  <void property="remoteScmSupported"> 
   <boolean>true</boolean> 
  </void> 
  <void property="repositories"> 
   <void method="add"> 
    <object class="org.opensolaris.opengrok.history.RepositoryInfo"> 
     <void property="datePattern"> 
      <string>yyyy-MM-dd&apos;T&apos;HH:mm:ss.SSS&apos;Z&apos;</string> 
     </void> 
     <void property="directoryName"> 
      <string>C:\OpenGrok\source\Configuration</string> 
     </void> 
     <void property="remote"> 
      <boolean>true</boolean> 
     </void> 
     <void property="type"> 
      <string>Subversion</string> 
     </void> 
     <void property="working"> 
      <boolean>true</boolean> 
     </void> 
    </object> 
   </void> 
  </void> 
  <void property="sourceRoot"> 
   <string>C:\OpenGrok\source</string> 
  </void> 
  <void property="verbose"> 
   <boolean>true</boolean> 
  </void> 
 </object> 
</java> 
Doolie answered 15/4, 2010 at 23:45 Comment(0)
K
3

I once had the same problem. You need to make sure svn is include the $PATH of your web server. Otherwise, the web application won't be able to call svn and History/Annotate link would be grayed out.

Related post: http://opensolaris.org/jive/thread.jspa?messageID=416663

Kaminsky answered 31/5, 2010 at 4:0 Comment(4)
You also need <void property="remoteScmSupported"><boolean>true</boolean></void> in the org.opensolaris.opengrok.configuration.Configuration configuration.Kamenskuralski
@Artefacto: could you please mention exactly which configuration file you are talking about ? :) There are so many configuration files (tomcat, opengrok, etc... to set up)Currie
@m3rLinEz : could you please describe how exactly SVN Path can be added to the webserver's path ?Currie
@SkippyFastol From the shell that you use to start Tomcat, if you can call $ svn then it means svn is in $PATH and you should be fine. If not, you can do export PATH=$PATH:/path/to/svn/bin to add it before starting Tomcat. But this post was from over two years I'm not sure how things might have changed.Kaminsky

© 2022 - 2024 — McMap. All rights reserved.