【发布时间】:2011-04-19 10:32:43
【问题描述】:
我有一个目录,其中包含来自旧版构建系统的文件。我想在 SVN 存储库中重新创建此构建系统的时间线。
为此,我必须获取每个构建,提取其所有文件,将它们放在合理的目录结构中,将整个目录结构提交给 svn,并为每个构建创建标签(以便轻松识别它们)。现在,我能够从该系统中获取文件,将它们放在一个目录结构中,并且我正在尝试使用 SVNKit 将整个目录放入 SVN(因为整个同步系统是一个使用 Java 代码的系统)。
所以,我要做的是
- 使用
SVNWCClient.doAdd(main.workDirectory, true, false, false, SVNDepth.INFINITY, false, false /* we only add files below this path */)将所有新文件添加到svn - 然后使用
SVNCommitClient.doCommit(changedFiles, false, null, commitProps, null, false, true, SVNDepth.INFINITY)提交整个目录
不幸的是,它并没有那么好......
确实,每次我尝试调用这些方法时,我都会得到
Exception in thread "main" org.tmatesoft.svn.core.SVNException: svn: Commit failed (details follow):
svn: 'E:\JavaWorkspace\workDirectory\subpath\deep\below\initial\path' is not under version control
and is not part of the commit,
yet its child is part of the commit
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:85)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:69)
at org.tmatesoft.svn.core.wc.SVNCommitClient.doCollectCommitItems(SVNCommitClient.java:1236)
at org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:825)
at com.perigee.svnsync.SvnExecutor.commit(SvnExecutor.java:229)
at com.perigee.svnsync.SvnSynchronizer.examineRelease(SvnSynchronizer.java:40)
Caused by: org.tmatesoft.svn.core.SVNException: svn: 'E:\JavaWorkspace\workDirectory\subpath\deep\below\initial\path' is not under version control
and is not part of the commit,
yet its child is part of the commit
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
at org.tmatesoft.svn.core.internal.wc.SVNCommitUtil.harvestCommitables(SVNCommitUtil.java:546)
at org.tmatesoft.svn.core.wc.SVNCommitClient.doCollectCommitItems(SVNCommitClient.java:1208)
请注意,当我使用 TortoiseSVN 查看这个文件夹时,它似乎是一个完美的“普通”文件夹,可以添加到 SVN 中......此外,我可以使用 TortoiseSVn 提交根目录及其所有子目录,而无需最小的问题。那么,我可以/应该更改我的代码以使其正常工作吗?
【问题讨论】:
标签: java tortoisesvn commit svnkit