我需要动态更改 svn 存储库中文件的版本化自定义属性的值。我不想更改任何内容,只需更改已存在文件的属性值即可。我在java中使用svnkit。
我该怎么办?
example:
http:://svnserver.com/example/directorya/file1.txt ... has svn property: myproperty = abc
after the operation:
http:://svnserver.com/example/directorya/file1.txt ... has svn property: myproperty = def
这是我尝试过的,但它不起作用。它没有更改文件属性,而是向整个存储库添加了提交,而不涉及文件 file1.txt。
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.closeEdit();