変更された単一のファイルをコミットしたい。http://wiki.svnkit.com/Committing_To_A_Repositoryによると、次のコードを使用します。
public static SVNCommitInfo modifyFile(ISVNEditor editor, String dirPath, String filePath, InputStream is, long size) throws SVNException {
try {
SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
editor.openRoot(-1);
editor.openDir(dirPath, -1);
editor.openFile(filePath, -1);
editor.applyTextDelta(filePath, null);
String chksm = deltaGenerator.sendDelta(filePath, is, editor, true);
editor.textDeltaEnd(filePath);
editor.closeFile(filePath, chksm);
/*
* Closes the directory.
*/
editor.closeDir();
/*
* Closes the root directory.
*/
editor.closeDir();
return editor.closeEdit();
} catch (SVNException e) {
if (editor != null) {
try {
editor.abortEdit();
} catch (Exception ex) {
}
}
throw e;
}
}
しかし、残念ながら、外観を所有するユーザーによってコミットが行われているにもかかわらず、例外が発生します。
org.tmatesoft.svn.core.SVNException: svn: E175002: PUT of '/spielwiese/!svn/wrk/e9019037-4201-0010-b534-277444c0b279/postcommittesten.txt': 423 Locked (http://localhost:8081)
svn: E175002: PUT request failed on '/spielwiese/!svn/wrk/e9019037-4201-0010-b534-277444c0b279/postcommittesten.txt'
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:106)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:90)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:739)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:369)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:728)
at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.doPutDiff(DAVConnection.java:514)
at org.tmatesoft.svn.core.internal.io.dav.DAVCommitEditor.closeFile(DAVCommitEditor.java:335)
私は何を間違っていますか?正しい方法は?
SVNCommitClientを使用しようとしました。しかし、SVNCommitClient は、単一のファイルをコミットするためにローカル作業コピーを必要とし、ローカル作業コピーを作成したくありません。したがって、ファイルを特定の場所のリポジトリに直接コミットしたいと考えています。
現在のユーザーによってロックされているファイルをコミットするにはどうすればよいですか?