13

I want to write an application which identifies the current changesets and tags them. I do know we can get the changeset by using hg identify.

Once I get the changeset, is there a way I can tag it?

Thanks

Vinay
  • 1,016
  • 8
  • 22

2 Answers2

21

From the documentation:

hg tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...

So this should work:

$ hg tag -r revision tagname
  • Thanks for the document. It helps a lot – Vinay Aug 10 '12 at 14:03
  • 3
    Also `hg help tag`. Lots of useful help built-in. – Mark Tolonen Aug 10 '12 at 15:47
  • Hmm, when I do this, it creates a new branch with the changeset of my tag-change on it. Is there a way to get it to put that changeset on the current branch? Edit: Nevermind, I was upped to the changeset also; once I ran "hg up" to get to tip, the command worked. – TahoeWolverine Jan 28 '16 at 20:52
1
$ hg tag -r changeset tagname

Thanks

Geeky User
  • 21
  • 3