SamplesUtility.createRepository(reposRoot);
SVNCommitInfo info = SamplesUtility.createRepositoryTree(reposRoot);
//print out new revision info
System.out.println(info);
SVNClientManager clientManager = SVNClientManager.newInstance();
SVNURL reposURL = SVNURL.fromFile(reposRoot);
//copy A to A_copy in repository (url-to-url copy)
SVNCopyClient copyClient = clientManager.getCopyClient();
SVNURL A_URL = reposURL.appendPath("A", true);
SVNURL copyTargetURL = reposURL.appendPath("A_copy", true);
SVNCopySource copySource = new SVNCopySource(SVNRevision.UNDEFINED, SVNRevision.HEAD, A_URL);
info = copyClient.doCopy(new SVNCopySource[] { copySource }, copyTargetURL, false, false, true,
"copy A to A_copy", null);
//print out new revision info
System.out.println(info);
//checkout the entire repository tree
SamplesUtility.checkOutWorkingCopy(reposURL, wcRoot);
//now make some changes to the A tree
SamplesUtility.writeToFile(new File(wcRoot, "A/B/lambda"), "New text appended to 'lambda'", true);
SamplesUtility.writeToFile(new File(wcRoot, "A/mu"), "New text in 'mu'", false);
SVNWCClient wcClient = SVNClientManager.newInstance().getWCClient();
wcClient.doSetProperty(new File(wcRoot, "A/B"), "spam", SVNPropertyValue.create("egg"), false,
SVNDepth.EMPTY, null, null);
//commit local changes
SVNCommitClient commitClient = clientManager.getCommitClient();
commitClient.doCommit(new File[] { wcRoot }, false, "committing changes", null, null, false, false, SVNDepth.INFINITY);
//now make some local changes to the A_copy tree
//change file contents of A_copy/B/lambda and A_copy/mu
SamplesUtility.writeToFile(new File(wcRoot, "A_copy/B/lambda"), "New text in copied 'lambda'", true);
SamplesUtility.writeToFile(new File(wcRoot, "A_copy/mu"), "New text in copied 'mu'", false);
//now diff the base revision of the working copy against the repository
SVNDiffClient diffClient = clientManager.getDiffClient();
/*
* Since we provided no custom ISVNOptions implementation to SVNClientManager, our
* manager uses DefaultSVNOptions, which is set to all SVN*Client classes which the
* manager produces. So, we can cast ISVNOptions to DefaultSVNOptions.