开发者

Why separate tags file in Mercurial

开发者 https://www.devze.com 2023-04-05 08:49 出处:网络
I have been reading about mercurial tags. I can see, usually, we tag a changeset开发者_JAVA技巧 to mark a release point and these tags are revision controlled too.

I have been reading about mercurial tags. I can see, usually, we tag a changeset开发者_JAVA技巧 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?


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号