This website says hg tag 1.0
is to get my Mercurial repository to a tag name.
How can I switch my repository to that tag name?
$ hg tag myTag1.0
$ <edit more files>
$ hg commit -m "a message"
$ hg how to go back to that tag?
And if I make a new hg commit
here, what will happen? Will it go to the branch of myTag1.0
? Or will it stay on the default branch?
To add a tag to the system, simply add a line to this file and then commit it for it to take effect. The hg tag command will do this for you and hg tags will show the currently effective tags.
From the main menu, select Hg | Mercurial | Update to. In the Switch Working Directory dialog that opens, specify the target working directory: To switch to another line of development, choose Branch and select the desired branch from the list.
Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed.
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. You'll have to use the -f option to tell Mercurial that you really want to update the tag.
Tags are not branches. Tags are markers for a particular commit - basically, a way to name commits. That's all. You don't "switch a repository to a tag" any more than you would "switch a repository to a commit" - you can check out a tag, but all that does is roll back your working copy to the corresponding changeset which was tagged.
Branches are created automatically in Mercurial when you commit code that doesn't directly build off of the current head revision.
See here for some more details:
https://www.mercurial-scm.org/wiki/Tag
https://www.mercurial-scm.org/wiki/Branch
Just update to the tag name.
hg tag 1.0
... make changes ...
hg ci
hg up 1.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With