gpt4 book ai didi

svn - 如何svn转储特定文件夹并将其加载到特定位置

转载 作者:行者123 更新时间:2023-12-03 03:05:07 25 4
gpt4 key购买 nike

这就是故事,我有以下 svn 存储库 -

Fruit
- Banana
- trunk
- Mango

Vegetables
- Potato
- trunk
- Mango
- trunk

事实证明,我们一直在为 Mango 项目使用错误的存储库(Vegetables),并且我们在 Fruit 存储库中有一个现有的 Mango 文件夹。所以我的任务是将文件夹 Vegetables\Mango\trunk 放入 Fruit\Mango。这是我的尝试 -

// I dump the vegetables repo
svnadmin dump C:\Repos\Vegetables > Vegetables.dump

// I then filter the dump to only include Mango/trunk
svndumpfilter --drop-empty-revs --renumber-revs include Mango/trunk < Vegetables.dump > Mango-trunk.dump

// Finally, I load the filtered dump file into the Fruit/Mango
svnadmin load C:\Repos\Fruit --parent-dir Mango < Mango-trunk.dump

最终的 Fruit 存储库如下 -

Fruit
- Banana
- trunk
- Mango
- Mango
- trunk

这显然是假设的,但它反射(reflect)了我现在遇到的问题。我不知道如何在没有父目录的情况下单独迁移主干文件夹。我什至尝试根据我对文件系统的错误假设对过滤后的转储进行转储过滤,但这无济于事。我需要执行该确切任务的提示,建议的替代方案对我没有帮助,谢谢。

最佳答案

SVN 手册有 example如何将顶级目录移动到其自己的存储库中,您应该能够适应您的情况。

基本过程是在使用 svnadmin load 加载转储文件之前手动编辑转储文件。首先,从转储文件的 Node-pathNode-copyfrom-path header 中删除前导 Mango/ 。然后,删除转储文件中创建 Mango 目录的部分。它看起来像这样:

Node-path: Mango
Node-action: add
Node-kind: dir
Content-length: 0

但请注意以下几点:

Warning

If you do plan on manually editing the dump file to remove a top-level directory, make sure your editor is not set to automatically convert end-of-line characters to the native format (e.g., \r\n to \n), as the content will then not agree with the metadata. This will render the dump file useless.

现在您可以加载转储文件。

关于svn - 如何svn转储特定文件夹并将其加载到特定位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25648571/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com