In my repository, I have tags of the form version-1.2.3. I would like to make a revset alias new() that is called like this:
hg log -r 'new(1.2.3, 1.2.4)'
...and expands to this:
hg log -r '::version-1.2.4 - ::version-1.2.3' # What's new in 1.2.4?
When I tried to do this:
[revsetalias]
new($1, $2) = ::version-$2 - ::version-$1
...Mercurial interpreted it as subtracting the revision $2 (e.g. 1.2.3) from the revision version, which was not my intent.
I also tried this, using the ## concatenation operator:
new($1, $2) = ::"version-" ## $2 - ::"version-" ## $1
But then hg log -r 'new(1.2.3, 1.2.4)' gives me this error:
hg: parse error at 13: syntax error
I also tried using ancestors() instead of the :: syntax, but still got the syntax error. Is this possible to do?
I tested the following that works:
For reference
$1::$2won't give you the same thing, it means the revision between$1and$2An equivalent revset that I would prefer is:According to the doc it is strictly equivalent to what you want: