重命名后如何将SVN文件夹拆分为自己的存储库? [英] How to split an SVN folder into its own repository when it has been renamed?

查看:43
本文介绍了重命名后如何将SVN文件夹拆分为自己的存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个目录从一个大型 Subversion 存储库拆分为一个自己的存储库,并将文件的历史记录保留在该目录中.

I want to split a directory from a large Subversion repository to a repository of its own, and keep the history of the files in that directory.

我先尝试了常规方法

svnadmin dump /path/to/repo > largerepo.dump
cat largerepo.dump | svndumpfilter include my/directory >mydir.dump

但这不起作用,因为多年来该目录已被移动和复制,并且文件已被移入和移出存储库的其他部分.结果是很多这样的:

but that does not work, since the directory has been moved and copied over the years and files have been moved into and out of it to other parts of the repository. The result is a lot of these:

svndumpfilter: Invalid copy source path '/some/old/path'

接下来我尝试包含那些出现的 /some/old/path ,在包含一长串文件和目录之后,svndumpfilter 完成,但导入生成的转储不是'不产生与当前目录相同的文件.

Next thing I tried is to include those /some/old/path as they appear and after a long, long list of files and directories included, the svndumpfilter completes, BUT importing the resulting dump isn't producing the same files as the current directory has.

那么,如何在保留历史记录的同时正确地从该存储库中拆分目录?

我特别希望 trunk/myproj 成为新存储库中的主干,并且新存储库不包含任何其他旧内容,即.任何人都不应该在拆分之前更新到旧版本并获取/查看文件.

I specifically want trunk/myproj to be the trunk in a new repository PLUS have the new repository include none of the other old stuff, ie. there should not be possibility for anyone to update to old revision before the split and get/see the files.

我尝试过的 svndumpfilter 解决方案正好可以实现这一点,遗憾的是它不可行,因为路径/文件已被移动.ng 的解决方案是不可接受的,因为它基本上是克隆+删除额外内容保留所有历史记录,而不仅仅是相关的 myproj 历史记录.

The svndumpfilter solution I tried would achieve exactly that, sadly its not doable since the path/files have been moved around. The solution by ng isn't accetable since its basically a clone+removal of extras which keeps ALL the history, not just relevant myproj history.

推荐答案

当 svndumpfilter 包含的目录/文件之一最初是从未包含的树部分复制或移动时,会出现此问题.

This problem occurs when one of the directories/files included by svndumpfilter originally was copied or moved from a section of the tree that is not being included.

要解决此问题,请使用此脚本:svndumpfilter3

To solve the problem use this script: svndumpfilter3

这篇关于重命名后如何将SVN文件夹拆分为自己的存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆