In Mercurial 2.4
a template keyword {p2rev}
was added that can be used to determine if a changeset is a merge.
hg log -r42 --template {p2rev}
If this returns "-1", there is no second parent, hence the changeset is not a merge, otherwise it is a merge.
But most devs here still are on Mercurial 2.1.1
. Using {p2rev}
on their machines always returns [blank].
I tried in 2.1.1:
hg log -r42 --template {parents}
and this gives a bit weird output:
- if there is only 1 parent (not a merge): no output
- if there are 2 parents (merge): the {rev}:{node} of both parents
What is the best way to determine if a changeset is a merge in Mercurial pre-2.4, say 2.1.1
?
I am using Mercurial 2.2.2 (Ubuntu 12.10) and it seems that this is working (using the Revision Sets query language):