≻ hg version Mercurial Distributed SCM (version 4.4.2+390-b963750b125f) (see https://mercurial-scm.org for more information) Copyright (C) 2005-2017 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Broken version: ≻ ./hg log -r '.^::' -T '{shortest(node,8)}\n' hg: parse error at 4: not a prefix: end Working versions: ≻ ./hg log -r '(.^)::' -T '{shortest(node,8)}\n' 8bb90cc4 b378a3d8 ≻ ./hg log -r '.^::all()' -T '{shortest(node,8)}\n' 8bb90cc4 b378a3d8 ≻ ./hg log -r '.^::.' -T '{shortest(node,8)}\n' 8bb90cc4 b378a3d8 I assume what's happening is that ^ is being interpreted before the ::, so hg is parsing this as (.)^(::), i.e. x^n where x=., n=::, and not like (.^)::, i.e. x::y, where x=.^ and y is unspecified.
> parsing this as (.)^(::) Exactly. This is a limitation of the current parser with 1 lookahead, but it's confusing that x^::y is allowed but x^:: isn't. https://www.mercurial-scm.org/repo/hg/rev/805651777188
Fixed by https://mercurial-scm.org/repo/hg/rev/beb667c9880f Yuya Nishihara <yuya@tcha.org> revset: parse x^:: as (x^):: (issue5764) We have to make '::' a valid primary expression to parse 'x^::' as '(x)^(::)' first, but that doesn't change the language because a prefix operator '::y' precedes a primary '::'. I can't think of an intuitive meaning of '::', so it's just rejected. Given 'x::y' can be considered to default to {x = roots(), y = heads()}, '::' could be 'roots()::heads()', which seems not any useful. (please test the fix)