Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why separate tags file in Mercurial

Tags:

mercurial

tags

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?

like image 744
Abidi Avatar asked Sep 17 '11 18:09

Abidi


People also ask

What is mercurial tag?

A tag is a symbolic identifier for a changeset. It can contain any characters except ":" (colon), "\r" (Carriage Return) or "\n" (Line Feed). Mercurial has two kinds of tags: local and regular.

How do you remove a tag on mercurial?

If you want to remove a tag that you no longer want, use hg tag --remove . You can also modify a tag at any time, so that it identifies a different revision, by simply issuing a new hg tag command.

What is hg status?

hg status shows the status of a repository. Files are stored in a project's working directory (which users see), and the local repository (where committed snapshots are permanently recorded). hg add tells Mercurial to track files. hg commit creates a snapshot of the changes to 1 or more files in the local repository.


1 Answers

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.

like image 58
Jesse Avatar answered Sep 27 '22 23:09

Jesse