Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Creating tags in Hg is really easy. First, let's see what tags are in the repository. In our case, there's only the one marked tip which represents as I said before the very most recent changeset in the main branch along the trunk. Again, remember the numbers, you see on the screen the changeset ID and the hash may differ between this system and your system. Create a tag it's very easy, hg tag v1, and now we do hg tags.
Now we can see that we now have two tags tip and v1 to check out the version marked by a tag we use hg update. But let's make a tag without tag v1 now. Let's make a change to our mainline and check it in so that we can switch back and forth between the tag and the mainline we can see the difference. So we'll come in here, and we'll change this colon to an ellipses, we'll commit that, and now we type f1.c. You can see we have the ellipses there, but if we see hg update, now we type f1.c, you can see it's back to a colon, and if we type hg update, and you can see it's back to the ellipses. So that's how easy it is to do tags in Hg.
Just remember when you switch back to the tag, you're essentially moving the update pointer backwards. So you may want to create a branch if you're going to be making changes when you switch back to say version 1 in order to make an update to version 1 of your source code. But branching and merging is very easy in Hg, and we'll see that in the next movie.
Get unlimited access to all courses for just $25/month.Become a member