private void addFileOrDir(FSRevisionRoot srcRoot, FSRevisionRoot tgtRoot, String tgtPath, String editPath, SVNNodeKind tgtKind) throws SVNException { if (tgtKind == SVNNodeKind.DIR) { myEditor.addDir(editPath, null, -1); deltifyDirs(srcRoot, tgtRoot, null, tgtPath, editPath); myEditor.closeDir(); } else { myEditor.addFile(editPath, null, -1); deltifyFiles(srcRoot, tgtRoot, null, tgtPath, editPath); FSRevisionNode tgtNode = tgtRoot.getRevisionNode(tgtPath); myEditor.closeFile(editPath, tgtNode.getFileMD5Checksum()); } }
SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(svnUrl)); SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator(); ISVNEditor editor = repository.getCommitEditor("This is a log message.", new CommitMediator()); editor.openRoot(-1); editor.addFile("testThisTextCommit1.txt", null, -1); editor.applyTextDelta(svnUrl, null); InputStream is = SVNFileUtil.openFileForReading(file); String chksm = deltaGenerator.sendDelta(svnUrl, is, editor, true); is.close(); editor.textDeltaEnd("testThisTextCommit1.txt"); editor.closeFile("testThisTextCommit1.txt", chksm); editor.closeEdit();
SVNRepository repository = SVNRepositoryFactory.create(url); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(user,password); repository.setAuthenticationManager(authManager); ISVNEditor editor = repository.getCommitEditor("comment" , null); editor.openRoot(-1); editor.openFile("/file1.txt", -1); editor.changeFileProperty("/file1.txt", "mypropertyname", SVNPropertyValue.create("myvalue")); editor.closeFile("/file1.txt",null); editor.closeEdit();
SVNRepository repository = SVNRepositoryFactory.create(url); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(user,password); repository.setAuthenticationManager(authManager); SVNPropertyValue svnPropertyValue = SVNPropertyValue.create("def"); ISVNEditor editor = repository.getCommitEditor("comment", null); editor.openRoot(-1); editor.openDir("dirname", -1); editor.changeDirProperty("myproperty", svnPropertyValue); editor.closeEdit();
public static void setSpecialWCProperties(ISVNEditor editor, boolean isDir, String path, DAVElement property, SVNPropertyValue propValue) throws SVNException { String propName = convertDAVElementToPropName(property); if (propName != null) { if (isDir) { editor.changeDirProperty(propName, propValue); } else { editor.changeFileProperty(path, propName, propValue); } } }
private static void replaceFileOrDir(FSFS fsfs, ISVNEditor editor, FSRevisionRoot srcRoot, FSRevisionRoot tgtRoot, String srcPath, String tgtPath, String editPath, SVNNodeKind tgtKind) throws SVNException { long baseRevision = srcRoot.getRevision(); if (tgtKind == SVNNodeKind.DIR) { editor.openDir(editPath, baseRevision); deltifyDirs(fsfs, editor, srcRoot, tgtRoot, srcPath, tgtPath, editPath); editor.closeDir(); } else { editor.openFile(editPath, baseRevision); deltifyFiles(fsfs, editor, srcRoot, tgtRoot, srcPath, tgtPath, editPath); FSRevisionNode tgtNode = tgtRoot.getRevisionNode(tgtPath); editor.closeFile(editPath, tgtNode.getFileMD5Checksum()); } }
public void applyTextDelta(String path, String baseChecksum) throws SVNException { if (myCurrentFileBaton.myIsAmbientlyExcluded) { return; } myDelegate.applyTextDelta(path, baseChecksum); }
public void openFile(String path, long revision) throws SVNException { myCurrentFileBaton = makeFileBaton(myCurrentDirBaton, path); if (myCurrentFileBaton.myIsAmbientlyExcluded) { return; } myDelegate.openFile(path, revision); }
public void closeDir() throws SVNException { if (!myCurrentNodeBaton.myIsFiltered) { myDelegate.closeDir(); } myCurrentNodeBaton = myCurrentNodeBaton.myParentBaton; }
@Override public void handleEndRevision(long revision, SVNProperties revisionProperties, ISVNEditor editor) throws SVNException { editor.closeEdit(); } });
public SVNCommitInfo closeEdit() throws SVNException { ISVNEditor wrappedEditor = getWrappedEditor(); if (!myIsRootOpened) { wrappedEditor.openRoot(myBaseRevision); } myCommitInfo = wrappedEditor.closeEdit(); if (myHandler != null) { SVNLogEntry logEntry = new SVNLogEntry(null, myCommitInfo.getNewRevision(), myCommitInfo.getAuthor(), myCommitInfo.getDate(), null); myHandler.handleLogEntry(logEntry); } return myCommitInfo; }
@Override public void openDir(String path, long revision) throws SVNException { if (editor != null) editor.openDir(path, revision); allowDelete = true; }
public void openRoot(long revision) throws SVNException { //open root myCommitEditor.openRoot(myPreviousRevision); EntryBaton baton = new EntryBaton("/"); baton.myPropsAct = ACCEPT; myDirsStack.push(baton); }
public void closeFile(String path, String textChecksum) throws SVNException { if (myCurrentFileBaton.myIsAmbientlyExcluded) { return; } myDelegate.closeFile(path, textChecksum); }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { myCurrentFileBaton = makeFileBaton(myCurrentDirBaton, path); if (myCurrentFileBaton.myIsAmbientlyExcluded) { return; } myDelegate.addFile(path, copyFromPath, copyFromRevision); }
public boolean handleCommitPath(String commitPath, ISVNEditor commitEditor) throws SVNException { commitEditor.addDir(commitPath, null, -1); return true; } };
public static void sendDeltaAndClose(@NotNull ISVNEditor editor, @NotNull String filePath, @Nullable byte[] oldData, @Nullable byte[] newData) throws SVNException, IOException { try ( ByteArrayInputStream oldStream = new ByteArrayInputStream(oldData == null ? emptyBytes : oldData); ByteArrayInputStream newStream = new ByteArrayInputStream(newData == null ? emptyBytes : newData) ) { editor.applyTextDelta(filePath, null); SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator(); String checksum = deltaGenerator.sendDelta(filePath, oldStream, 0, newStream, editor, true); editor.closeFile(filePath, checksum); } }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { if (myCurrentDirBaton.myIsAmbientlyExcluded) { return; } myDelegate.changeDirProperty(name, value); }
public void applyTextDelta(String path, String baseChecksum) throws SVNException { if (!myCurrentNodeBaton.myIsFiltered) { myDelegate.applyTextDelta(path, baseChecksum); } }
public void openFile(String path, long revision) throws SVNException { myCurrentFileBaton = makeFileBaton(myCurrentDirBaton, path); if (myCurrentFileBaton.myIsAmbientlyExcluded) { return; } myDelegate.openFile(path, revision); }