Я хочу зафиксировать модифицированный отдельный файл. По http://wiki.svnkit.com/Committing_To_A_Repository я использую следующий код:SVNKit: SVNException при фиксации заблокированного файла
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 нуждается в локальной рабочей копии для фиксации отдельных файлов, и я не хочу создавать локальную рабочую копию. Поэтому я хочу напрямую передать файл в репозиторий в определенном месте.
Как я могу зафиксировать файл, который заблокирован текущим пользователем?
Что версия SVNKit? Какова версия сервера SVN? Какова версия рабочего формата SVN? Был ли замок в рабочей копии получен с помощью SVNKit? –
SVNKit 1.7.9. Нет рабочей копии, потому что мы напрямую передаем удаленный репозиторий. – shylynx