distance to tag

Johannes Totz johannes at jo-t.de
Thu Feb 27 13:12:25 UTC 2014


On 27/02/2014 11:18, Kastner Masilko, Friedrich wrote:
>> From: mercurial-bounces at selenic.com
>> [mailto:mercurial-bounces at selenic.com] On Behalf Of Johannes Totz
>> 
>> How do I get the number of revisions between a given revision X
>> and another given tag/revision Y (along the longest or shortest
>> path)? I know there's latesttagdistance but it's not quite what I'm
>> after.
>> 
>> I guess something like... hg log -r X:Y --template "{node|short}" |
>> wc -l
>> 
>> ...would work. But is there a built-in function? I'm mainly on
>> windows, no wc there.
> 
> May I ask why you need the distance? Is it perhaps some kind of
> dot-version generation from revision ancestry?

Indeed! :)
I need to produce one in the pattern of 1.2.3.4. Build numbers and
similar stuff are quite annoying to manage, so I thought might as well
generate that reliably from the repo itself.




More information about the Mercurial mailing list