开发者

Most recent tag before tip in mercurial

开发者 https://www.devze.com 2023-02-05 03:06 出处:网络
I mark releases with hg tag <version开发者_如何学Python-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 th

I mark releases with hg tag <version开发者_如何学Python-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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消