在 Mercurial 中禁用特定文件集的文件历史记录
据我所知,在 Mercurial 中,您永远不会删除文件的历史记录,除非您类似这样的。 是否有任何方法可以禁用某些文件的历史记录?。如果任何其他存储库系统能够做到这一点,也请把它记下来。
我为什么想要那个?好吧,在我们的构建系统中,不断提交新的二进制文件,非程序员可以使用它们来运行程序,而无需每次都进行编译(编译由构建系统完成)。每次提交新的二进制文件时,旧的二进制文件对我们来说都是无用的。它不必要地占用了空间。如果新的二进制文件万一出现问题,我们总是可以恢复到旧的源并重建(假设有一种方法可以禁用特定文件的历史记录)。
I understand that in mercurial you can never remove a history for a file unless you do something like this. Is there any way to disable history for certain files from ever being created?. If any other repository system is capable of doing that, please put that down as well.
Why would I want that? Well, in our build system, new binaries are constantly being committed which the non-programmers can use to run the program without compiling every time (the compilation is done by the build system). Each time new binaries are committed, the old ones are useless as far as we are concerned. It is unnecessarily taking up space. If the new binary messes up by any chance, we can always revert back to older source and rebuild (assuming there is a way to disable history for specific files).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如您所发现的,您无法直接在 Mercurial 中执行您想要的操作。
我建议您将二进制文件放在其他地方 - Subversion subrepo 将是一个不错的选择。这样,您将只在客户端上下载每个文件的最新版本,但您将在服务器上拥有所有版本(应该很容易添加更多磁盘空间)。
As you found out, you cannot do what you want directly in Mercurial.
I suggest you put the binaries somewhere else -- a Subversion subrepo would be a good choice. That way you will only download the latest version of each file on the client, but you will have all versions on your server (where it should be easy to add more disk space).