我需要动态更改svn目录的版本化自定义属性的值。 我不想改变任何内容,只需更改现有目录的属性值。 我在java中使用svnkit。
我该怎么做?
example:
http:://svnserver.com/example/directorya ... has svn property: myproperty = abc
after the operation:
http:://svnserver.com/example/directorya ... has svn property: myproperty = def
答案 0 :(得分:1)
以某种方式让它发挥作用:
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();