I mark releases with hg tag <version-number>
. When I release a bugfix, I don't want to increment the version number, but I want to use the most recent version number during the build process. If I run hg tags
, it will show tip
first, then the version numbers in descending order. I can get it running hg tags | head -n2 | tail -n1
. I wonder if there is a more elegant, pure mercurial way to get it.
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.
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.
hg graft has additional functionality over and above simple cherry picking of one revision. For example, you can graft a range of revisions onto another branch.
Description. Update the repository's working directory to the specified changeset. If no changeset is specified, update to the tip of the current named branch and move the active bookmark (see hg help bookmarks). Update sets the working directory's parent revision to the specified changeset (see hg help parents).
Well, I'm answering my own question. I found the solution, hg help templates
shows more options than the documentation on the mercurial site. So hg tip --template '{latesttag}\n'
is what I was looking for.
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