SVNDumpFilter在添加路径之前更改路径?

时间:2014-07-22 14:00:39

标签: svn svndump svndumpfilter

我正在使用svndumpfilter从更大的仓库中提取单个项目并将它们导入到自己的仓库中。像这样:

svndumpfilter include --drop-empty-revs --renumber-revs Trunk/Source/Project1 < full.dump > Project1.dump

它对一个项目有效,但在第二个项目中,我注意到生成的过滤转储不是通过添加路径开始的。请参阅前两个版本(重新编号):

SVN-fs-dump-format-version: 2

UUID: c6612063-4e6b-459c-a579-78605fb1e4b5

Revision-number: 0
Prop-content-length: 56
Content-length: 56

K 8
svn:date
V 27
2010-05-11T20:45:07.903005Z
PROPS-END

Revision-number: 1
Prop-content-length: 128
Content-length: 128

K 7
svn:log
V 27
Fixed code after branching.
K 10
svn:author
V 6
somedude
K 8
svn:date
V 27
2010-09-21T23:07:51.719341Z
PROPS-END

Node-path: Trunk/Source/Project1/Project1.csproj
Text-content-md5: 9d127596909e2a9921f1ec1c0223e1ed
Node-action: change
Text-content-sha1: 22eb675e0a5bfb41092de6ed39dc7c4d2a15dbd5
Node-kind: file
Text-content-length: 5178
Content-length: 5178

注意它是如何在首先添加Trunk/Source/Project1/Project1.csproj之前尝试“更改”的?毫不奇怪,在过滤的转储上运行svnadmin load时,我收到“找不到文件”。有什么想法吗?

1 个答案:

答案 0 :(得分:3)

有三种方式:

  1. 在加载转储文件之前通过提交添加丢失的文件夹:svn mkdir http://server/svn/project/Trunk -m "Created Trunk"
  2. 手动将创建Trunk文件夹的节点记录添加到转储中:

    Revision-number: 1
    Prop-content-length: 128
    Content-length: 128
    
    K 7
    svn:log
    V 27
    Fixed code after branching.
    K 10
    svn:author
    V 6
    somedude
    K 8
    svn:date
    V 27
    2010-09-21T23:07:51.719341Z
    PROPS-END
    
    Node-path: Trunk/
    Node-kind: dir
    Node-action: add
    Prop-content-length: 48
    Content-length: 48
    
    PROPS-END
    
    
    Node-path: Trunk/Source/Project1/Project1.csproj
    Text-content-md5: 9d127596909e2a9921f1ec1c0223e1ed
    Node-action: change
    Text-content-sha1: 22eb675e0a5bfb41092de6ed39dc7c4d2a15dbd5
    Node-kind: file
    Text-content-length: 5178
    Content-length: 5178
    
  3. 根本不使用svndumpfilter,因为它被设计破坏了( svndumpsanitizer &#39; s home page有一个好的解释为什么)。您很可能会在转储中遇到其他错误。

  4. 我目前正在通过大量的合并,移动和其他类似的东西拆分一个非常复杂的仓库,我可以说周围没有任何东西能够正确地分割svn转储100%。

    <击>

    <击>

    例如众所周知的svndumpfilterIN包含至少三个主要错误(我只能设法报告one of them而其他两个更加邪恶)并且在我的回购中失败了。我会在一段时间后尝试在GitHub上分享它的固定版本,但在目前状态下,我无法推荐它。

    所以在我看来,你最好的机会是在没有--redefine-root选项的情况下尝试上面提到的svndumpsanitizer,因为它也会被窃听(bugreport即将到来)。如果您使用的是Windows,则使用最新的Visual Studio Community 2013(免费)进行编译。

    <击>


    在Y2K17

    中更新

    上面的最后两段不再相关,因为我已修复svndumpfilterIN中的所有问题,这些问题阻止我转换我的回购。 My PR已合并到基础仓库,因此请尝试一下。我仍然无法保证100%的成功,但现在你的机会要高得多。