[英]See svn commit messages/comments when get sync source in eclipse
[英]SVN KIT commit comments issue
我正在使用SVNKIT提交SVN中的更改。 它按预期在Java中运行良好。 问题是注释未保存在svn中。 我正在做类似下面的事情:
String comment = "testing here";
ISVNEditor editor = repository.getCommitEditor(comment, null /*locks*/ , false /*keepLocks*/ , null /*mediator*/ );
SVNCommitInfo commitInfo = modifyFile(editor, "", "filePath", contents, modifiedContents);
和modifyFile方法如下
private static SVNCommitInfo modifyFile(ISVNEditor editor, String dirPath,
String filePath, byte[] oldData, byte[] newData) throws SVNException {
editor.openRoot(-1);
editor.openDir(dirPath, -1);
editor.openFile(filePath, -1);
editor.applyTextDelta(filePath, null);
SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
String checksum = deltaGenerator.sendDelta(filePath, new ByteArrayInputStream(oldData), 0, new ByteArrayInputStream(newData), editor, true);
editor.closeFile(filePath, checksum);
editor.closeDir();
editor.closeDir();
return editor.closeEdit();
}
我无法找到关于为什么未保存评论的错误。 同样的Maven条目是-
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.11</version>
好的,多亏了我一位聪明的队友,我找到了解决方案。 在1.8.11版本中似乎存在一个错误,并且不允许保存注释。 我将pom.xml中的版本更改为1.7.5,它像任何东西一样工作。
代码未做任何更改。 可能对同样遇到困难的其他人有所帮助
从SVNKIT 1.8.9开始,支持Subversion1.8的临时事务属性[请参阅https://subversion.apache.org/docs/api/1.8/group__Capabilities.html#gae1424ec62e198a77499726431c35ab6e] ,这会引起问题。 因此,使用1.8.9之前的任何SVNKIT版本都不会出现此错误。 请参阅https://svn.svnkit.com/repos/svnkit/branches/1.8.x/CHANGES.txt以了解SVNKIT在多个版本中所做的更改
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.