Setting repository location on SVNKit's SvnGetStatus

100 views Asked by At

I need to get the current revision of a local working copy.

So far I've come up with this: (EDITED)

private static long resolve(File workingDirectory) throws SVNException {
    SvnOperationFactory svnOpFactory = new SvnOperationFactory();
    SvnGetStatus svnGetStatus = svnOpFactory.createGetStatus();
    svnGetStatus.setSingleTarget(SvnTarget.fromFile(workingDirectory));
    svnGetStatus.setDepth(SVNDepth.EMPTY);
    SvnStatus status = svnGetStatus.run();
    return status.getRevision();
}

I can't find a place to actually specify the location of my working copy, not even in the documentation.

How can I tell SvnGetStatus where to look for the working copy?

1

There are 1 answers

6
Ian Roberts On BEST ANSWER

Try setting it as the target of the operation:

svnGetStatus.setSingleTarget(SvnTarget.fromFile(wcLocation))