例如,我在带有外部的 svn 中有一个项目
- 我的项目 | |--------东西1 |--------东西2 |--------external-lib // svn::external
我需要在 external-lib 目录中添加一个文件(一个 Makefile),我想在我的存储库(myproject
)中将其 commint,而不是外部的。不要修改外部存储库非常重要。可能吗?我想使用外部存储库的头版本。
例如,我在带有外部的 svn 中有一个项目
- 我的项目 | |--------东西1 |--------东西2 |--------external-lib // svn::external
我需要在 external-lib 目录中添加一个文件(一个 Makefile),我想在我的存储库(myproject
)中将其 commint,而不是外部的。不要修改外部存储库非常重要。可能吗?我想使用外部存储库的头版本。
我建议将 Makefile 直接存储到 myproject 中。然后你可以使用从 external-lib 运行它
make -f ../Makefile.external
Based upon the response to my comment under your question, if your server and client(s) are using Subversion 1.6.x, you can do this. With Subversion 1.6.x, the support of externals for file is now available. So for each file and directory contained at the svn::external path, you'll need to create and entry in the svn:externals property for the myproject directory.
The svn:externals property will look something like this:
^/external-lib/file1 file1
^/external-lib/directoryA directoryA
^/external-lib/file2 file2
^/external-lib/directoryB directoryB
You can read more about svn:externals here: http://svnbook.red-bean.com/nightly/en/svn.advanced.externals.html
Now, as long as external-lib and myproject exist in the same repository, the working copies will allow you to commit changes to files and directories in external-lib.
除非您自己创建外部存储库的分支并完全放弃 svn:externals,否则您想要的东西是不可能的。当然,这意味着您必须自己维护对外部库的更新,通过合并(这可能相对容易自动化,因为除了添加此文件之外您不会修改任何内容)。
也就是说,马丁的解决方案在您的情况下似乎是阻力最小的路径......