2

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

2 に答える 2

4

closeFile()を呼び出さなかったので、ファイル名の前に「/」が必要でしたが、機能するようになりました

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.closeFile("/file1.txt",null);
editor.closeEdit();
于 2011-10-05T11:21:53.737 に答える
-1

SVNDeltaGeneratorとsendDeltaメソッドを使用できます。

于 2021-11-10T13:47:23.177 に答える