Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法使用SVNKit提交目录树_Java_Tortoisesvn_Commit_Svnkit - Fatal编程技术网

Java 无法使用SVNKit提交目录树

Java 无法使用SVNKit提交目录树,java,tortoisesvn,commit,svnkit,Java,Tortoisesvn,Commit,Svnkit,我有一个目录,其中包含来自旧版构建系统的文件。我想在SVN存储库中重新创建此构建系统的时间线 为此,我必须获取每个构建,提取其所有文件,将它们放在合理的目录结构中,将整个目录结构提交给svn,并为每个构建创建标记(以便轻松识别它们)。现在,我可以从该系统中获取文件,将它们放在目录结构中,并尝试使用SVNKit将整个目录放在SVN中(因为整个同步系统都使用Java代码) 所以,我要做的是 使用将所有新文件添加到svn 然后使用 不幸的是,它没有那么好用 事实上,每次我尝试调用这些方法时,我都会 E

我有一个目录,其中包含来自旧版构建系统的文件。我想在SVN存储库中重新创建此构建系统的时间线

为此,我必须获取每个构建,提取其所有文件,将它们放在合理的目录结构中,将整个目录结构提交给svn,并为每个构建创建标记(以便轻松识别它们)。现在,我可以从该系统中获取文件,将它们放在目录结构中,并尝试使用SVNKit将整个目录放在SVN中(因为整个同步系统都使用Java代码)

所以,我要做的是

  • 使用将所有新文件添加到svn
  • 然后使用
  • 不幸的是,它没有那么好用

    事实上,每次我尝试调用这些方法时,我都会

    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提交根目录及其所有子目录,而没有任何问题。那么,我是否可以/应该更改代码以使其正常工作?

    事实上,存在一个微妙的问题。让我解释一下

    当我调用
    SVNCommitClient.doCommit(changedFiles,false,null,commitProps,null,false,true,SVNDepth.INFINITY)
    时,SVNKit希望我像真正的svn命令行客户机一样,给as files数组(第一个参数,
    changedFiles
    )一个提交基目录列表。有关更多信息,请查看

    我使用该命令所做的是精确地在每个文件夹上直接提交它。不幸的是,由于这是我的第一次提交,这些文件目录还不在SVN中,因此提交失败得很惨

    因此,解决方案是将
    changedFiles
    替换为使用的根目录,这样就简单了