error("error while making a new directory at '" + url + "'", svne);
}
System.out.println("Committed to revision " + committedRevision);
System.out.println();
Resource anImportDir = new Resource(myHomePath+importDir);
Resource anImportFile = new Resource(anImportDir, SVNPathUtil.tail(importFile));
/*
* creates a new local directory - './importDir' and a new file -
* './importDir/importFile.txt' that will be imported into the repository
* into the '/MyRepos/importDir' directory
*/
createLocalDir(anImportDir, new Resource[]{anImportFile}, new String[]{importFileText});
System.out.println("Importing a new directory into '" + importToURL + "'...");
try{
/*
* recursively imports an unversioned directory into a repository
* and displays what revision the repository was committed to
*/
boolean isRecursive = true;
committedRevision = wc.importDirectory(anImportDir, importToURL, "importing a new directory '" + anImportDir.getAbsolutePath() + "'", isRecursive).getNewRevision();
}catch(SVNException svne){
error("error while importing a new directory '" + anImportDir.getAbsolutePath() + "' into '" + importToURL + "'", svne);
}
System.out.println("Committed to revision " + committedRevision);
System.out.println();
/*
* creates a local directory where the working copy will be checked out into
*/
Resource wcDir = new Resource(myHomePath+myWorkingCopyPath);
if (wcDir.exists()) {
error("the destination directory '"
+ wcDir.getAbsolutePath() + "' already exists!", null);
}
wcDir.mkdirs();
System.out.println("Checking out a working copy from '" + url + "'...");
try {
/*
* recursively checks out a working copy from url into wcDir.
* SVNRevision.HEAD means the latest revision to be checked out.
*/
wc.checkout(url, SVNRevision.HEAD, wcDir, true);
} catch (SVNException svne) {
error("error while checking out a working copy for the location '"
+ url + "'", svne);
}
System.out.println();
/*
* recursively displays info for wcDir at the current working revision
* in the manner of 'svn info -R' command
*/
try {
wc.showInfo(wcDir, SVNRevision.WORKING, true, new InfoHandler());
} catch (SVNException svne) {
error("error while recursively getting info for the working copy at'"
+ wcDir.getAbsolutePath() + "'", svne);
}
System.out.println();
Resource aNewDir = new Resource(wcDir, newDir);
Resource aNewFile = new Resource(aNewDir, SVNPathUtil.tail(newFile));
Resource aNewFileXml = new Resource(aNewDir, SVNPathUtil.tail(newFileXml));
/*
* creates a new local directory - 'wcDir/newDir' and a new file -
* '/MyWorkspace/newDir/newFile.txt'
*/
createLocalDir(aNewDir, new Resource[]{aNewFile,aNewFileXml}, new String[]{fileText,fileTextXml});