6

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.

2 Answers 2

11

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.

0

Use the ParentRevSpecExtension: https://www.mercurial-scm.org/wiki/ParentrevspecExtension
It allows you to say tip~1.

EDIT: Sorry, that doesn't answer the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.