0

Java で SVNKit ライブラリを使用して、変更されたファイルを SVN リポジトリにコミットできませんでした。残念ながらデバッグできるスタック トレース情報がありません。

ファイルは Java プログラムを使用して変更されており、SVN を使用して変更されたファイルをコミットする必要があります。(svn commit -m "更新")。

ファイルは変更されており、「svn status」コマンドを実行すると次のように表示されます。

svn ステータス ファイル名

M ファイル名

ここに私のコードがあります:

try {
String url = "http://repository URL";
File file = new File("<path to file>"+inputFile);

DAVRepositoryFactory.setup();
SVNURL svnurl = SVNURL.parseURIDecoded(url);
SVNCommitInfo commitInfo;
String uname = <username>; // auth details to connect to SVN repo
String pwd = <password>;

pw.println("<br> SVN URL is : "+ svnurl); //pw is a reference object of response.getWriter()
DAVRepository repo = (DAVRepository) DAVRepositoryFactory.create(svnurl);
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(uname, pwd);
repo.setAuthenticationManager(authManager);

long latestRevision = repo.getLatestRevision();
pw.println("<br> LATEST REVISION IS : "+latestRevision);
/*
SVNClientManager clientManager = SVNClientManager.newInstance(null,repo.getAuthenticationManager());
try {
SVNUpdateClient uc = clientManager.getUpdateClient();
uc.doUpdate(file, SVNRevision.HEAD, true);
SVNCommitClient cc = clientManager.getCommitClient();
commitInfo = cc.doCommit(new File[] {file}, false, "Updated regex", null, null, false, false,          SVNDepth.INFINITY);
pw.println("<br> COMMIT INFORMATION : "+commitInfo);
} finally {
clientManager.dispose();
}
*/
} catch (Exception e) {
pw.println(e.getMessage());
}

私の出力: SVN URL is : repository URL [Ljava.lang.StackTraceElement;@1e610e3 (そして変更されたファイルはコミットされません)

どんな助けでも大歓迎です。ありがとう

4

0 に答える 0