From: <jbo...@li...> - 2005-11-28 16:28:15
|
Author: adamw Date: 2005-11-28 11:27:21 -0500 (Mon, 28 Nov 2005) New Revision: 1655 Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddDirectoryOperation.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddFileOperation.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyDirectoryOperation.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyFileOperation.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/PathsStack.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ResourceOperation.java Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/NodeContent.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnTools.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/test/CommitTest.java Log: http://jira.jboss.com/jira/browse/JBSHOTOKU-37 : first classes, implementation Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -23,6 +23,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -104,6 +105,19 @@ } /** + * Saves the given resources at one time. Recommended if you have multiple + * resources to save. + * + * @param resources + * Resources to save. + * @param logMessage + * Log message to save with. + * @throws RepositoryException + */ + public abstract void save(Collection<AbstractResource> resources, + String logMessage) throws RepositoryException; + + /** * Gets a velocity engine, initialized with default properties, as defined * in velocity.properties in shotoku-base jar. Additionaly, the shotoku * resource loader will be set to read templates from this content manager @@ -178,7 +192,7 @@ return ve; } - protected ContentManager(String id, String prefix) { + protected ContentManager(String id, String prefix) throws RepositoryException { this.id = id; this.prefix = prefix; } Modified: trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-base/src/java/org/jboss/shotoku/tools/Tools.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -94,6 +94,20 @@ } /** + * Concatenates two parts of a path into 1: returns a string + * <code>path1/path2</code>. + * + * @param path1 + * First path to concatenate. + * @param path2 + * Second path to concatenate. + * @return + */ + public static String concatenatePaths(String path1, String path2) { + return path1 + "/" + path2; + } + + /** * Concatenates two parts of a property name: returns a string * <code>property1.property2</code>. * Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/AbstractSvnResource.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -22,12 +22,14 @@ package org.jboss.shotoku.svn; import java.io.File; +import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.jboss.shotoku.AbstractResource; import org.jboss.shotoku.Directory; import org.jboss.shotoku.exceptions.RepositoryException; +import org.jboss.shotoku.svn.operations.ResourceOperation; /** * @author Adam Warski (ad...@as...) @@ -176,4 +178,13 @@ return new SvnDirectory(id, parentPath, parentFile, svnCm); } + + // TODO + public void addOperations(Collection<ResourceOperation> ops) { + + } + + public void addNodeContent(Map<String, NodeContent> contents) { + + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/NodeContent.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/NodeContent.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/NodeContent.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -151,4 +151,10 @@ return 0; } + + /* NOT USED */ + + public void delete() { + + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnContentManager.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -22,14 +22,35 @@ package org.jboss.shotoku.svn; import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.apache.commons.configuration.Configuration; +import org.jboss.shotoku.AbstractResource; import org.jboss.shotoku.ContentManager; import org.jboss.shotoku.Directory; import org.jboss.shotoku.Node; import org.jboss.shotoku.exceptions.RepositoryException; import org.jboss.shotoku.exceptions.ResourceDoesNotExist; +import org.jboss.shotoku.svn.operations.NodeContentMediator; +import org.jboss.shotoku.svn.operations.PathsStack; +import org.jboss.shotoku.svn.operations.ResourceOperation; import org.jboss.shotoku.tools.Tools; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.SVNURL; +import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; +import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; +import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; +import org.tmatesoft.svn.core.io.ISVNEditor; +import org.tmatesoft.svn.core.io.SVNRepository; +import org.tmatesoft.svn.core.io.SVNRepositoryFactory; +import org.tmatesoft.svn.core.wc.SVNWCUtil; /** * An implementation of the content manager based on subversion. @@ -40,21 +61,49 @@ /** * <code>service</code> - service interface binding. */ - private static SvnService service = SvnTools.getService(); + private static SvnService service; public static void setup(String id, Configuration conf) { service.registerRepository(id, conf); } + static { + service = SvnTools.getService(); + + // Configuring the repositories. + // for DAV (over http and https) + DAVRepositoryFactory.setup(); + + // for SVN (over svn and svn+ssh) + SVNRepositoryFactoryImpl.setup(); + } + /* * */ private int prefixLength; - public SvnContentManager(String id, String prefix, Configuration conf) { + private SVNRepository repository; + + public SvnContentManager(String id, String prefix, Configuration conf) + throws RepositoryException { super(id, prefix); prefixLength = prefix.length(); + + // Creating a new repository. + try { + repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded( + conf.getString(SvnTools.PROPERTY_URL))); + } catch (SVNException e) { + throw new RepositoryException(e); + } + + ISVNAuthenticationManager authManager = + SVNWCUtil.createDefaultAuthenticationManager( + conf.getString(SvnTools.PROPERTY_USERNAME), + conf.getString(SvnTools.PROPERTY_PASSWORD)); + repository.setAuthenticationManager(authManager); } /** @@ -168,4 +217,44 @@ return new SvnDirectory(id, getPrefixedPath(path), file, this); } + + @Override + public void save(Collection<AbstractResource> resources, + String logMessage) throws RepositoryException { + // Collection all operations to perform - duplicates are automatically + // removed as we use a Set. Alse, collecting NodeContent objects which + // will be used while executing operations, so we can initialize a + // NodeContentMediator. + Set<ResourceOperation> ops = new HashSet<ResourceOperation>(); + Map<String, NodeContent> contents = new HashMap<String, NodeContent>(); + for (AbstractResource resource : resources) { + AbstractSvnResource svnResource = (AbstractSvnResource) resource; + svnResource.addOperations(ops); + svnResource.addNodeContent(contents); + } + + // Sorting all operations. + List<ResourceOperation> opsList = + new ArrayList<ResourceOperation>(ops); + Collections.sort(opsList); + + try { + // We create a NodeContentMediator, later a PathStack, which will + // be supplied to all operations while executing. + ISVNEditor editor = repository.getCommitEditor(logMessage, + new NodeContentMediator(contents)); + + PathsStack stack = new PathsStack(editor); + + // Now that we have the good operation order, we can execute them. + for (ResourceOperation op : opsList) { + op.execute(stack); + } + + // Finally, closing the stack. + stack.close(); + } catch (SVNException e) { + throw new RepositoryException(e); + } + } } Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnTools.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnTools.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/SvnTools.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -31,6 +31,11 @@ * @author Damon Sicore (da...@si...) */ public class SvnTools { + public static final String PROPERTY_USERNAME = "username"; + public static final String PROPERTY_URL = "url"; + public static final String PROPERTY_PASSWORD = "password"; + public static final String PROPERTY_LOCALPATH = "localpath"; + private static SvnService instance; public static SvnService getService() { Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddDirectoryOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddDirectoryOperation.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddDirectoryOperation.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -0,0 +1,24 @@ +package org.jboss.shotoku.svn.operations; + +import org.jboss.shotoku.tools.Tools; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.io.ISVNEditor; + +public class AddDirectoryOperation extends ResourceOperation { + private String parentPath; + + public AddDirectoryOperation(String parentPath, String newName) { + super(Tools.concatenatePaths(parentPath, newName), + OpCode.ADD_DIRECTORY); + + this.parentPath = parentPath; + } + + public void execute(PathsStack stack) throws SVNException { + stack.accomodate(parentPath, true); + + ISVNEditor editor = stack.getEditor(); + editor.addDir(path, null, -1); + stack.addPath(path, false); + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddFileOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddFileOperation.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/AddFileOperation.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -0,0 +1,24 @@ +package org.jboss.shotoku.svn.operations; + +import org.jboss.shotoku.tools.Tools; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.io.ISVNEditor; + +public class AddFileOperation extends ResourceOperation { + private String parentPath; + + public AddFileOperation(String parentPath, String newName) { + super(Tools.concatenatePaths(parentPath, newName), + OpCode.ADD_FILE); + + this.parentPath = parentPath; + } + + public void execute(PathsStack stack) throws SVNException { + stack.accomodate(parentPath, true); + + ISVNEditor editor = stack.getEditor(); + editor.addFile(path, null, -1); + stack.addPath(path, true); + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyDirectoryOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyDirectoryOperation.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyDirectoryOperation.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -0,0 +1,26 @@ +package org.jboss.shotoku.svn.operations; + +import java.util.Map; + +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.io.ISVNEditor; + +public class ModifyDirectoryOperation extends ResourceOperation { + private Map<String, String> properties; + + public ModifyDirectoryOperation(String path, + Map<String, String> properties) { + super(path, OpCode.MODIFY_DIRECTORY); + + this.properties = properties; + } + + public void execute(PathsStack stack) throws SVNException { + stack.accomodate(path, true); + + ISVNEditor editor = stack.getEditor(); + + for (String key : properties.keySet()) + editor.changeDirProperty(key, properties.get(key)); + } +} \ No newline at end of file Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyFileOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyFileOperation.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ModifyFileOperation.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -0,0 +1,46 @@ +package org.jboss.shotoku.svn.operations; + +import java.util.Map; + +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.io.ISVNEditor; +import org.tmatesoft.svn.core.io.diff.SVNDiffWindow; +import org.tmatesoft.svn.core.io.diff.SVNDiffWindowBuilder; + +public class ModifyFileOperation extends ResourceOperation { + private int contentLength; + private Map<String, String> properties; + + public ModifyFileOperation(String path, int contentLength, + Map<String, String> properties) { + super(path, OpCode.MODIFY_FILE); + + this.contentLength = contentLength; + this.properties = properties; + } + + public void execute(PathsStack stack) throws SVNException { + stack.accomodate(path, false); + + ISVNEditor editor = stack.getEditor(); + if (!stack.isFileOpened()) { + editor.openFile(path, -1); + stack.addPath(path, true); + } + + for (String key : properties.keySet()) + editor.changeFileProperty(path, key, properties.get(key)); + + if (contentLength != -1) { + // While creating the ISVNEditor, it was supplied with a + // WorkspaceMediator which reads data from already created + // NodeContent objects. So no need to write anything (in fact, + // we shouldn't, as the ostream is null). + editor.applyTextDelta(path, null); + SVNDiffWindow diffWindow = SVNDiffWindowBuilder + .createReplacementDiffWindow(contentLength); + editor.textDeltaChunk(path, diffWindow); + editor.textDeltaEnd(path); + } + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/PathsStack.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/PathsStack.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/PathsStack.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -0,0 +1,85 @@ +package org.jboss.shotoku.svn.operations; + +import java.util.Stack; + +import org.jboss.shotoku.tools.Tools; +import org.tmatesoft.svn.core.SVNException; +import org.tmatesoft.svn.core.io.ISVNEditor; + +public class PathsStack { + private Stack<String> pathsStack; + private boolean fileOnTop; + private ISVNEditor editor; + + public PathsStack(ISVNEditor editor) throws SVNException { + pathsStack = new Stack<String>(); + fileOnTop = false; + this.editor = editor; + + editor.openRoot(-1); + } + + /** + * Accomodates the paths opened in editor to the given new path. This + * should be used only to open existing directories. + * @param newPath + * @param openLast + * @throws SVNException + */ + public void accomodate(String newPath, boolean openLast) + throws SVNException { + // If there's a file opened, always closing it. + if (fileOnTop) { + // Checking if we don't want to have the same file opened. + if (newPath.equals(pathsStack.peek())) + return; + + editor.closeFile(pathsStack.pop(), null); + fileOnTop = false; + } + + // Poping and closing all opened directories which + // don't fit into the new path. + while (!newPath.startsWith(pathsStack.peek())) { + pathsStack.pop(); + editor.closeDir(); + } + + // Opening directories from the new path and putting their paths on the + // stack. + String currentPath = pathsStack.peek(); + String[] parts = newPath.substring(currentPath.length()).split("[/]"); + for (int i=0; i < (openLast ? parts.length : parts.length - 1); i++) { + currentPath += Tools.concatenatePaths(parts[i], ""); + editor.openDir(currentPath, -1); + pathsStack.push(currentPath); + } + } + + public void addPath(String path, boolean file) { + pathsStack.push(file ? path : Tools.concatenatePaths(path, "")); + fileOnTop = file; + } + + public boolean isFileOpened() { + return fileOnTop; + } + + public ISVNEditor getEditor() { + return editor; + } + + public void close() throws SVNException { + if (isFileOpened()) { + editor.closeFile(pathsStack.pop(), null); + } + + while (!pathsStack.empty()) { + editor.closeDir(); + pathsStack.pop(); + } + + editor.closeDir(); + editor.closeEdit(); + } +} Added: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ResourceOperation.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ResourceOperation.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/operations/ResourceOperation.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -0,0 +1,53 @@ +package org.jboss.shotoku.svn.operations; + +import org.tmatesoft.svn.core.SVNException; + +/** + * An base class for operations on the repository. + * @author adamw + */ +public abstract class ResourceOperation implements Comparable<ResourceOperation> { + protected enum OpCode { + ADD_DIRECTORY, + ADD_FILE, + MODIFY_FILE, + MODIFY_DIRECTORY; + } + + protected String path; + protected OpCode opCode; + + public ResourceOperation(String path, OpCode opCode) { + this.path = path; + this.opCode = opCode; + } + + public int compareTo(ResourceOperation ro) { + int pathsCompare = path.compareTo(ro.path); + if (pathsCompare == 0) + return opCode.compareTo(ro.opCode); + + return pathsCompare; + } + + @Override + public boolean equals(Object obj) { + ResourceOperation ro = (ResourceOperation) obj; + return path.equals(ro.path) && opCode.equals(ro.opCode); + } + + @Override + public int hashCode() { + return path.hashCode() + opCode.hashCode(); + } + + /** + * Executes the specific acitons represented by this object. + * + * @param stack + * Paths stack which represents the currently open paths, and is + * an access point to a ISVNEditor instance. + * @throws SVNException + */ + public abstract void execute(PathsStack stack) throws SVNException; +} Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -37,6 +37,7 @@ import org.jboss.shotoku.svn.RevisionInfo; import org.jboss.shotoku.svn.SvnOperationFailed; import org.jboss.shotoku.svn.SvnService; +import org.jboss.shotoku.svn.SvnTools; import org.jboss.shotoku.svn.service.operations.AddDelayedOperation; import org.jboss.shotoku.svn.service.operations.CommitDelayedOperation; import org.jboss.shotoku.svn.service.operations.DeleteDelayedOperation; @@ -146,10 +147,10 @@ public void registerRepository(String id, Configuration conf) { if (repositories.get(id) == null) { SvnRepository repo = new SvnRepository( - conf.getString("username"), - conf.getString("password"), - conf.getString("url"), - conf.getString("localpath")); + conf.getString(SvnTools.PROPERTY_USERNAME), + conf.getString(SvnTools.PROPERTY_PASSWORD), + conf.getString(SvnTools.PROPERTY_URL), + conf.getString(SvnTools.PROPERTY_LOCALPATH)); repositories.put(id, repo); Modified: trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/test/CommitTest.java =================================================================== --- trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/test/CommitTest.java 2005-11-27 22:22:15 UTC (rev 1654) +++ trunk/forge/portal-extensions/shotoku/shotoku-svn/src/java/org/jboss/shotoku/test/CommitTest.java 2005-11-28 16:27:21 UTC (rev 1655) @@ -10,7 +10,6 @@ import org.tmatesoft.svn.core.SVNCommitInfo; import org.tmatesoft.svn.core.SVNException; -import org.tmatesoft.svn.core.SVNNodeKind; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; @@ -19,8 +18,6 @@ import org.tmatesoft.svn.core.io.ISVNWorkspaceMediator; import org.tmatesoft.svn.core.io.SVNRepository; import org.tmatesoft.svn.core.io.SVNRepositoryFactory; -import org.tmatesoft.svn.core.wc.ISVNOptions; -import org.tmatesoft.svn.core.wc.SVNClientManager; import org.tmatesoft.svn.core.wc.SVNWCUtil; public class CommitTest { @@ -34,9 +31,8 @@ ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager( "jbf...@jb...", "rO@B5oPfff"); repository.setAuthenticationManager(authManager); - - SVNNodeKind nodeKind = null; - nodeKind = repository.checkPath("", -1); + + repository.checkPath("", -1); long latestRevision = -1; latestRevision = repository.getLatestRevision(); @@ -45,8 +41,6 @@ System.out.println(""); ISVNEditor editor = repository.getCommitEditor("zzz", new WorkspaceMediator()); - - SVNCommitInfo commitInfo = null; editor.openRoot(-1); editor.addDir("/test2", null, -1); |