因为我是这个 SVNKIT 的新手。请任何人都可以为我提供创建新文本文件 SVN 存储库的代码。
例如:file:///E:/SVN/IDS/MSCVE
我想在 MSCVE 文件夹中添加一个新的文本文件。
它必须看起来像下面的树结构
file:///E:/SVN/IDS/MSCVE/newtextfile.txt
提前致谢。
您是否尝试过按照 SVNKit Wiki 中的说明进行操作?请参阅提交到存储库。
以下代码添加文件nodeC/itemC2
,添加文本,然后更改其上的一些属性:
//the second and the third parameters are the path and revision respectively
//of the item's ancestor if the item is being added with history
editor.addFile( "nodeC/itemC2" , null , -1 );
baseChecksum = ...;
editor.applyTextDelta( "nodeC/itemC2" , baseChecksum );
baseData = ...;
workingData = ...;
checksum = deltaGenerator.sendDelta( "nodeC/itemC2" , baseData , 0 , workingData , editor , true );
editor.closeFile( "nodeC/itemC2" , checksum );
editor.changeFileProperty( "nodeC/itemC2" , "propName1" , "propValue1" );
editor.changeFileProperty( "nodeC/itemC2" , "propName2" , "propValue2" );