简体   繁体   English

将 SVN 外部转换为普通目录

[英]Convert SVN External to Normal Directory

This seems like a it would be pretty simple to do but I have not had any luck finding the answer.这似乎很简单,但我没有找到答案。 I have project with the following structure:我有以下结构的项目:

trunk
    src
    Doc
    lib
        external-lib1
        external-lib2

Of course the external-lib1 and external-lib2 are external svn repos.当然external-lib1external-lib2是外部 svn 存储库。 I want to convert this so that the main repo has the exact same file structure but the lib directory contains regular directories.我想转换它,以便主 repo 具有完全相同的文件结构,但 lib 目录包含常规目录。 It would be great if the history of the externals cold be preserved but that is not required.如果保留外部冷的历史记录会很棒,但这不是必需的。 The result should look like this:结果应如下所示:

trunk
    src
    Doc
    lib
        lib1
        lib2

The only way to make this change is to create by hand lib-1, lib-2 directories, and make a svn checkout http://link/to/external/library lib-n for every external svn repository you have linked (there isn't a svn switch similar command).进行此更改的唯一方法是手动创建 lib-1、lib-2 目录,并为您链接的每个外部 svn 存储库创建一个svn checkout http://link/to/external/library lib-n (有不是svn switch类似的命令)。 This works only if you are able to reach the external repositories.这仅在您能够访问外部存储库时才有效。 At the end you can cancel the external links.最后,您可以取消外部链接。

Another possible way is to make a dump of the repositories (it preserve the history of the repo) and load in your repository.另一种可能的方法是转储存储库(它保留存储库的历史记录)并加载到您的存储库中。

I think the first way is simple...我认为第一种方法很简单......

Hope that helps希望有帮助

Here is one solution without preserving the history of the externals assuming that you are in Windows:假设您在 Windows 中,这是一种不保留外部历史记录的解决方案:

svn checkout https://<repo>/trunk/lib lib
cd lib
svn propdel svn:externals .
svn commit -m "Removing svn:externals property"
rmdir /s /q lib1\.svn
rmdir /s /q lib2\.svn
svn add * --force
svn commit -m "Adding converted externals"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM