简体   繁体   English

SVN KIT提交评论问题

[英]SVN KIT commit comments issue

I am using SVNKIT to commit changes in SVN. 我正在使用SVNKIT提交SVN中的更改。 it is running fine as expected in java. 它按预期在Java中运行良好。 problem is comments are not being saved in svn. 问题是注释未保存在svn中。 i am doing something like below: 我正在做类似下面的事情:

String comment = "testing here";
ISVNEditor editor = repository.getCommitEditor(comment, null /*locks*/ , false /*keepLocks*/ , null /*mediator*/ );
SVNCommitInfo commitInfo = modifyFile(editor, "", "filePath", contents, modifiedContents);

and modifyFile methos is like below 和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();
    }

i am not able to find the mistake as to why comments are not being saved. 我无法找到关于为什么未保存评论的错误。 maven entry for same is - 同样的Maven条目是-

<groupId>org.tmatesoft.svnkit</groupId>
        <artifactId>svnkit</artifactId>
        <version>1.8.11</version>

ok, thanks to one of my intelligent teammate, i found the solution. 好的,多亏了我一位聪明的队友,我找到了解决方案。 there seems to be a bug in 1.8.11 version and it doesn't allow comments to be saved. 在1.8.11版本中似乎存在一个错误,并且不允许保存注释。 i changed the version in pom.xml to 1.7.5 and it works like anything. 我将pom.xml中的版本更改为1.7.5,它像任何东西一样工作。

No change in code was done. 代码未做任何更改。 might be helpful to others who are struggling with same issue 可能对同样遇到困难的其他人有所帮助

From SVNKIT 1.8.9 onwards there is support for ephemeral transactional properties of Subversion1.8 [Refer https://subversion.apache.org/docs/api/1.8/group__Capabilities.html#gae1424ec62e198a77499726431c35ab6e] which is causing the problem. 从SVNKIT 1.8.9开始,支持Subversion1.8的临时事务属性[请参阅https://subversion.apache.org/docs/api/1.8/group__Capabilities.html#gae1424ec62e198a77499726431c35ab6e] ,这会引起问题。 So using any SVNKIT version prior to 1.8.9 should not give this error. 因此,使用1.8.9之前的任何SVNKIT版本都不会出现此错误。 Refer https://svn.svnkit.com/repos/svnkit/branches/1.8.x/CHANGES.txt to know about changes made in SVNKIT over multiple version 请参阅https://svn.svnkit.com/repos/svnkit/branches/1.8.x/CHANGES.txt以了解SVNKIT在多个版本中所做的更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM