我有一个目录,其中包含来自旧版构建系统的文件。我想在 SVN 存储库中重新创建此构建系统的时间线。
为此,我必须获取每个构建,提取其所有文件,将它们放在一个合理的目录结构中,将整个目录结构提交给 svn,并为每个构建创建标签(以便轻松识别它们)。现在,我能够从该系统中获取文件,将它们放在一个目录结构中,并且我正在尝试使用 SVNKit 将整个目录放入 SVN(因为整个同步系统是一个使用 Java 代码的系统)。
所以,我要做的是
- 使用将所有新文件添加到 svn
SVNWCClient.doAdd(main.workDirectory, true, false, false, SVNDepth.INFINITY, false, false /* we only add files below this path */)
- 然后使用提交整个目录
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 提交根目录及其所有子目录,而不会出现最小的问题。那么,我可以/应该更改我的代码以使其正常工作吗?