Skip to content

Instantly share code, notes, and snippets.

@tksk
Created August 15, 2012 16:35
Show Gist options
  • Save tksk/3361438 to your computer and use it in GitHub Desktop.
Save tksk/3361438 to your computer and use it in GitHub Desktop.
svnkit.scala
::#!
@echo off
call C:\path\to\sbt\scalas %0 %*
goto :eof
::!#
/***
scalaVersion := "2.9.2"
libraryDependencies ++= Seq(
"org.tmatesoft.svnkit" % "svnkit" % "1.7.5-v1",
"org.tmatesoft.svnkit" % "svnkit-cli" % "1.7.5-v1"
)
*/
import org.tmatesoft.svn.core._
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory
import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory
import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl
import org.tmatesoft.svn.core.io._
import org.tmatesoft.svn.core.wc.SVNWCUtil
DAVRepositoryFactory.setup
import collection.JavaConversions._
val repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded("http://subclipse.tigris.org/svn/subclipse/trunk"))
val authManager = SVNWCUtil.createDefaultAuthenticationManager("guest", "tiger")
repository.setAuthenticationManager(authManager)
for(ent <- repository.getDir("", -1, null, null.asInstanceOf[java.util.Collection[_]])) {
println(ent)
}
println("hit enter to close")
readLine
@nemoo
Copy link

nemoo commented Aug 28, 2013

this is helpful!
when i try it i get: value foreach is not a member of java.util.Collection[?0]
how can i access stuff like ent.getAuthor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment