change svn directory property on the fly with svnkit

强颜欢笑 提交于 2019-12-08 13:07:36

问题


I need to change the value of a versioned custom property of a svn directory on the fly. I do not want to alter any content, just change the value of the property of the already existing directory. I am using svnkit in java.

How would i go about it?

example: 
http:://svnserver.com/example/directorya   ... has svn property: myproperty = abc

after the operation:
http:://svnserver.com/example/directorya   ... has svn property: myproperty = def

回答1:


somehow got it to work:

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();


来源:https://stackoverflow.com/questions/7469488/change-svn-directory-property-on-the-fly-with-svnkit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!