Package org.tmatesoft.svn.core.io

Examples of org.tmatesoft.svn.core.io.ISVNEditor

@version 1.3 @author TMate Software Ltd. @since 1.2 @see ISVNReporterBaton @see Examples

            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                                                         "path with name '{0}' is a file, you need a directory",
                                                         root);
            throw new SVNException(err);
        } else if (rootKind == SVNNodeKind.DIR) {
            ISVNEditor editor = repository.getCommitEditor(message, null, true, null);
            if (root.length() == 1 && root.charAt(0) == '/') {
                addProcess(repository, editor, root, "", child);
            } else {
                String rootPath = root.substring(1);
                addProcess(repository, editor, rootPath, null, child);
View Full Code Here


            this.path = path;
        }

        public void applyAction( Object context ) throws SVNException {

            ISVNEditor editor = (ISVNEditor)context;

            openDirectories(editor, this.root);
            String[] paths = this.path.split("/");
            String newPath = this.root;
            for (int i = 0, length = paths.length; i < length; i++) {
                newPath = (newPath.length() != 0) ? newPath + "/" + paths[i] : paths[i];

                editor.addDir(newPath, null, -1);
            }

            closeDirectories(editor, path);
            closeDirectories(editor, this.root);
        }
View Full Code Here

            this.file = file;
            this.content = content;
        }

        public void applyAction( Object context ) throws Exception {
            ISVNEditor editor = (ISVNEditor)context;
            openDirectories(editor, path);

            editor.addFile(path + "/" + file, null, -1);
            editor.applyTextDelta(path + "/" + file, null);
            SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
            String checksum = deltaGenerator.sendDelta(path + "/" + file, new ByteArrayInputStream(this.content), editor, true);
            editor.closeFile(path + "/" + file, checksum);

            closeDirectories(editor, path);

        }
View Full Code Here

     * @param message
     * @throws SVNException
     */
    public void execute( ScmAction action,
                         String message ) throws SVNException {
        ISVNEditor editor = this.repository.getCommitEditor(message, null);
        editor.openRoot(-1);
        try {
            action.applyAction(editor);
        } catch (Exception e) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "This error is appeared: '{0}'", e.getMessage());
            throw new SVNException(err);
        }
        editor.closeDir();
        editor.closeEdit();

    }
View Full Code Here

            }

            fireReplicatingEvent(currentRevision[0]);

            commitMessage = commitMessage == null ? "" : commitMessage;
            ISVNEditor commitEditor = SVNCancellableEditor.newInstance(dst.getCommitEditor(commitMessage, null), this, src.getDebugLog());

            SVNReplicationEditor bridgeEditor = null;
            try {
                bridgeEditor = new SVNReplicationEditor(src, commitEditor, currentRevision[0]);
                final long previousRev = i - 1;
View Full Code Here

        commitMessage = getCommitHandler().getCommitMessage(commitMessage, (SVNCommitItem[]) commitItems.toArray(new SVNCommitItem[commitItems.size()]));
        if (commitMessage == null) {
            return SVNCommitInfo.NULL;
        }
        commitMessage = SVNCommitUtil.validateCommitMessage(commitMessage);
        ISVNEditor commitEditor = repos.getCommitEditor(commitMessage, null, true, revisionProperties, null);
        try {
            commitEditor.openRoot(revNumber);
            if (kind == SVNNodeKind.FILE) {
                commitEditor.openFile("", revNumber);
                commitEditor.changeFileProperty("", propName, propValue);
                commitEditor.closeFile("", null);
            } else {
                commitEditor.changeDirProperty(propName, propValue);
            }
            commitEditor.closeDir();
        } catch (SVNException svne) {
            commitEditor.abortEdit();
        }
        if (handler != null) {
            handler.handleProperty(url, new SVNPropertyData(propName, propValue, getOptions()));
        }
        return commitEditor.closeEdit();
    }
View Full Code Here

            this.newPath = newPath;
            this.revision = revision;
        }

        public void applyAction(Object context) throws SVNException {
            ISVNEditor editor = ( ISVNEditor ) context;
            editor.addDir( newPath,
                           path,
                           revision );
            editor.closeDir();
        }
View Full Code Here

            this.newFile = newFile;
            this.revision = revision;
        }

        public void applyAction(Object context) throws SVNException {
            ISVNEditor editor = ( ISVNEditor ) context;
            CopyFile copyFile = new CopyFile( path,
                                              file,
                                              newPath,
                                              newFile,
                                              revision );
View Full Code Here

            this.newPath = newPath;
            this.revision = revision;
        }

        public void applyAction(Object context) throws SVNException {
            ISVNEditor editor = ( ISVNEditor ) context;
            CopyDirectory copyDirectory = new CopyDirectory( path,
                                                             newPath,
                                                             revision );
            DeleteDirectory deleteDirectory = new DeleteDirectory( path );
View Full Code Here

            this.path = path;
            this.file = file;
        }

        public void applyAction(Object context) throws SVNException {
            ISVNEditor editor = ( ISVNEditor ) context;
            openDirectories( editor,
                             path );
            editor.deleteEntry( path + "/" + file,
                                -1 );
            closeDirectories( editor,
                              path );
        }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.io.ISVNEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.