The last tag before the tip in mercury

I celebrate releases with hg tag <version-number>. When I release the patch, I do not want to increase the version number, but I want to use the most recent version number in the build process. If I run hg tags, it will show first tip, and then the version numbers in descending order. I can run it hg tags | head -n2 | tail -n1. I wonder if there is a more elegant, pure mercury way to get it.

+5
source share
2 answers

OK, I answer my question. I found a solution that hg help templatesshows more options than the documentation on the mercurial site. So, hg tip --template '{latesttag}\n'this is what I was looking for.

+10
source

ParentRevSpecExtension: https://www.mercurial-scm.org/wiki/ParentrevspecExtension
tip~1.

EDIT: , .

0

All Articles