Hello Dale, Our documentation is outdated, this is true. You can find examples in SVNKit sources.
You can have a look at sources of org.tmatesoft.svn.core.wc.SVNXXXClient classes. Every SVNXXXClient#doXXX of old SVNKit API is implement using new API. For example, SVNUpdateClient#doSwitch is implemented this way: public long doSwitch(File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky, boolean ignoreAncestry) throws SVNException { SvnSwitch sw = getOperationsFactory().createSwitch(); sw.setUpdateLocksOnDemand(isUpdateLocksOnDemand()); sw.setSwitchTarget(SvnTarget.fromURL(url, pegRevision)); sw.setSingleTarget(SvnTarget.fromFile(path)); sw.setRevision(revision); sw.setDepth(depth); sw.setDepthIsSticky(depthIsSticky); sw.setAllowUnversionedObstructions(allowUnversionedObstructions); sw.setIgnoreAncestry(ignoreAncestry); sw.setIgnoreExternals(isIgnoreExternals()); sw.setExternalsHandler(SvnCodec.externalsHandler(getExternalsHandler())); return sw.run(); } You can also have a look at org.tmatesoft.svn.test.XXXTest classes, they use both old and new API. Usually the code looks this way: final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); try { svnOperationFactory.setAuthenticationManager(authenticationManager); svnOperationFactory.setEventHandler(eventHandler); .......... svnOperationFactory.setZZZ(...); .......... final SvnXXX operation = svnOperationFactory.createXXX(); .......... operation.setYYY(...); ........ operation.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory)); operation.run(); } finally { svnOperationFactory.dispose(); } Note, that SvnOperationFactory contains SVN connections pool, so it can be reused between operations and it should be disposed after all. We will mostly add new SVN features to the new API only, so prefer the new API to the old API. -- Dmitry Pavlenko, TMate Software, http://subgit.com/ - git-svn bridge > Thanks, that worked nicely. Are there any other examples of how to use the > new API? I'm finding getting status doesn't work like it used to, so I'm > assuming I should update to use the new API to get correct status. The wiki > doesn't seem to have as much as it did in the past, so I'm wondering if I'm > looking in the wrong place for documentation? > > Thanks, > > Dale > > > > > On Wed, Jun 11, 2014 at 2:52 PM, Dmitry Pavlenko <pavle...@tmatesoft.com> > > wrote: > > Hello Dale, > > You can try this command: > > > > $ ./gradlew clean publish -Pto=/your/destination/directory -x > > svnkit:signMaven -x svnkit-javahl16:signMaven > > > > -- > > Dmitry Pavlenko, > > TMate Software, > > http://subgit.com/ - git-svn bridge > > > > > Hi Dmitry, > > > > > > A follow on question -- how can I build from source? The instructions > > > on the website appear to be out of date, referencing ant rather than > > > gradle. Running 'gradlew clean assemble' give this error: > > > > > > FAILURE: Build failed with an exception. > > > > > > * What went wrong: > > > Execution failed for task ':svnkit:signMaven'. > > > > > > > Cannot perform signing task ':svnkit:signMaven' because it has no > > > > > > configured signatory > > > > > > Any thoughts on this? I have checked out the latest svnkit code from > > > > trunk > > > > > at revision 10276. > > > > > > Thanks, > > > > > > Dale > > > > > > > > > > > > On Tue, Jun 10, 2014 at 4:42 AM, Dmitry Pavlenko > > > <pavle...@tmatesoft.com > > > > > > wrote: > > > > Hello Dale, > > > > Thanks for pointing to that, I fixed the problem at r10276 of SVNKit > > > > trunk. > > > > > > > > For now as a workaround you can also specify primary WC generation > > > > (SvnOperationFactory#setPrimaryWcGeneration) in addition to > > > > targetWorkingCopyFormat. > > > > -- > > > > Dmitry Pavlenko, > > > > TMate Software, > > > > http://subgit.com/ - git-svn bridge > > > > > > > > > Hi Dmitry, > > > > > > > > > > Actually, not so perfect. The way you described only works for 1.7 > > > > and > > > > > > 1.8 > > > > > > > > > working format. Choosing 1.6 working format gives this error: > > > > > > > > > > svn: E155036: Working copy format of '/path/to/directory' is too > > > > > old '10' > > > > > > > > > > Frankly, I'm not too concerned about people using versions older > > > > > than > > > > > > > > 1.7, > > > > > > > > > so really I'm just wondering if this approach should work? > > > > > > > > > > Here's the code I'm trying now > > > > > > > > > > final SvnCheckout checkout = > > > > > > > > > > client.getOperationsFactory().createCheckout(); > > > > > > > > > > checkout.setSource(SvnTarget.fromURL(SVNURL.parseURIDecoded > > > > > ( > > > > > > > > > > cd.getURL() ))); > > > > > > > > > > checkout.setSingleTarget(SvnTarget.fromFile(localPath)); > > > > > checkout.setTargetWorkingCopyFormat(wc_format); > > > > > Long revision = checkout.run(); > > > > > > > > > > Setting wc_format to anything less than ISVNWCDb.WC_FORMAT_17 > > > > > causes the same error I mentioned. > > > > > > > > > > Thanks, > > > > > > > > > > Dale > > > > > > > > > > On Fri, Jun 6, 2014 at 6:21 PM, Dale Anson <d...@daleanson.com> > > > > wrote: > > > > > > Perfect! Thank you! > > > > > > > > > > > > On Jun 6, 2014 4:42 PM, "Dmitry Pavlenko" > > > > > > <pavle...@tmatesoft.com> > > > > > > > > wrote: > > > > > >> Hello Dale, > > > > > >> Please have a look at my answer to a similar question: > > > > > >> > > > > > >> http://issues.tmatesoft.com/issue/SVNKIT-495 > > > > > >> > > > > > >> I hope this helps. > > > > > >> > > > > > >> client.getOperationsFactory().setPrimaryWcGeneration( > > > > > >> SvnWcGeneration.V16 ); > > > > > >> statement is not the valid way SVNKit API should be used. Use > > > > > >> > > > > > >> svnOperationFactory.createCheckout(); > > > > > >> > > > > > >> instead as in my answer to the issue. > > > > > >> -- > > > > > >> Dmitry Pavlenko, > > > > > >> TMate Software, > > > > > >> http://subgit.com/ - git-svn bridge > > > > > >> > > > > > >> > I'm updating the svn plugin for jEdit, which uses svnkit, to > > > > > >> > svnkit > > > > > >> > > > > > >> 1.8.5. > > > > > >> > > > > > >> > With previous versions (1.7.9 and earlier, anyway), it was > > > > > >> > possible > > > > > > > > to > > > > > > > > > >> set > > > > > >> > > > > > >> > the desired working copy format. This doesn't seem possible > > > > > >> > with 1.8.5. > > > > > >> > > > > > > >> > I was using code like this: > > > > > >> > > > > > > >> > SVNUpdateClient client = clientManager.getUpdateClient(); > > > > > >> > client.getOperationsFactory().setPrimaryWcGeneration( > > > > > >> > > > > > >> SvnWcGeneration.V16 > > > > > >> > > > > > >> > ); revision = client.doCheckout( SVNURL.parseURIDecoded( url > > > > > >> > ), > > > > > >> > > > > > >> localPath, > > > > > >> > > > > > >> > SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, true ); > > > > > >> > > > > > > >> > This used to checkout the code in 1.6 working copy format. > > > > > >> > With > > > > > > > > 1.8.5, > > > > > > > > > >> it's > > > > > >> > > > > > >> > always 1.8 format regardless of the value set in > > > > > >> > > > > > >> setPrimaryWcGeneration. Is > > > > > >> > > > > > >> > there a different way to achieve this with the new version of > > > > > > > > svnkit? > > > > > > > > > >> This > > > > > >> > > > > > >> > is a nice feature for people who for some reason, like > > > > > >> > compatibility > > > > > >> > > > > > >> with > > > > > >> > > > > > >> > other tools, can't use the 1.8 working format. > > > > > >> > > > > > > >> > Thanks, > > > > > >> > > > > > > >> > Dale