Subversion svn:外部文件覆盖?
我的一个项目有一个存储库,该项目有一个嵌套存储库,使用 svn:externals 属性从外部库更新文件。问题是我需要注释掉该库中标头之一的函数声明之一,并将修改后的标头与根存储库一起携带。
有没有办法可以做到这一点,以便在更新库时,它会用我的版本覆盖该特定文件?
I have a repository for one of my projects that has a nested repository using the svn:externals
property to update files from an external library. The problem is that I need to comment out one of the function declarations from one of the headers in this library, and carry around the modified header with the root repository.
Is there a way that this could be done, so that when the library is updated, it overrides that specific file with my version of it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对我来说,你想要的听起来像是“供应商分支”场景。
当前存储库
建议存储库
如何创建布局
创建 ^/vendor/library/current 并将原始未修改的库代码下载到其中。
修改 ^/myproject/library 并提交
如何在不丢失修改的情况下更新库
将库的最新原始版本下载到 ^/vendor/library/current OVERWRITING 文件中。
。
您可以分支到“my-modified-libs”目录并通过外部使用它,而不是直接将“当前”分支到您的项目中 如果您有多个项目需要相同的库修改版本,那么建议您这样做。
请记住,供应商分支机构在处理重命名和删除时会遇到问题,因为无法通过覆盖来跟踪这些问题。对于 SVN 来说,跨存储库合并是一个不同且相当年轻的主题。
如果您尝试一下,请给我们反馈效果如何:)
Christoph
What you want sounds like a "vendor branch" scenario to me.
current repository
suggested repository
How to create the layout
Create ^/vendor/library/current and DOWNLOAD the original unmodified library code into it.
modify ^/myproject/library and commit
How to update the library without losing your modifications
Download the latest original release of the library into ^/vendor/library/current OVERWRITING files.
profit
Instead of branching "current" directly into your project you could branch to a "my-modified-libs" directory and make use of it via externals. This would be advised if you have multiple projects that need the same modified version of a library.
Keep in mind that vendor branches will have problems dealing with renames and deletes as those can not be tracked by overwriting. Cross-repository merging is a different and rather young topic for SVN.
If you try it out, give us feedback how it went :)
Christoph
没有内置功能可以帮助您解决此问题。
处理这个问题的一般实践方法是:为您正在使用的库创建一个分支,然后在其中进行所需的更改,并使用新创建的分支作为根项目的外部分支。根据我的经验,我发现这是解决您所描述的问题的简单而有效的解决方案。
There isn't a built in feature to help you with this.
The general practice way of dealing with this would be: Make a branch of the library you're using then make the changes you need there and use the newly created branch as the external for the root project. In my experience I've found this to be a simple and effective solution to the problem you describe.