为什么在 Mercurial 中分离标签文件
我一直在阅读有关 Mercurial 标签的内容。我可以看到,通常我们标记变更集来标记发布点,并且这些标记也受到修订控制。
但我无法真正理解拥有 .hgtags
文件的想法。该文件的目的是什么?
I have been reading about mercurial tags. I can see, usually, we tag a changeset to mark a release point and these tags are revision controlled too.
But I could not really understand the idea of having a .hgtags
file. What is the purpose of this file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
拥有
.hgtags
文件允许使用与记录对所有其他文件的更改相同的格式来记录对.hgtags
文件的更改。它还允许以与传输文件更改相同的格式在存储库之间传输标签。这使得 Mercurial 能够实现一个用于存储目录更改的系统,以及一个用于将一堆更改传输到目录的协议,并在传输文件更改时自动处理分支和标签信息。
它还允许用户通过查看
.hgtags
文件的历史记录来查看项目标签的历史记录。Having a
.hgtags
file allows changes to the.hgtags
file to be recorded using the same format used to record changes to all other files. It also allows tags to be transferred between repositories in the same format used for transferring file changes.This allows Mercurial to implement one system for storing changes to a directory, and one protocol for transferring a bunch of changes to a directory and have branching and tag information automatically handled in the when transferring file changes.
It also allows the one to view the history of the tags for a project, by looking at the history of the
.hgtags
file.两个相关存储库中的标签名称可能会发生冲突。
EG 标签 A 可能在一个存储库中指向变更集 id X,而在另一个存储库中,相同的标签可能指向变更集 id Y。在合并期间,必须解决此冲突。
合并期间的冲突通过检查文件和相关修改来解决。
因此,标签必须存储在存储库中的普通文件中。
Tag names in two related repositories may be conflicting.
E.G. The tag A may in one repo point on changeset id X and in another repo the same tag may point on changeset id Y. During merge this conflict has to be solved.
Conflicts during merge are solved by inspecting files and the associated modifications.
Hence, the tags has to be stored in an ordinary file in the repo.
实际上,我认为拥有单独的标签文件根本没有任何用处。应该使用“log”命令很好地查看存储库历史记录(包括标签)。拥有标签文件还违反了一条重要规则:与版本控制系统严格相关的更改不应以任何方式更改存储库。
I actually see no usage at all for having a separate tags file. Repository history (including tags) should be well viewed with a 'log' command. Having the tags file also breaks an important rule: a change that is related strictly to the versioning system should not alter the repository in any way.