On Mon, 18 Feb 2019 14:25:42 -0500, Jordi Gutiérrez Hermoso wrote:
> On Mon, 2019-02-18 at 22:29 +0900, Yuya Nishihara wrote:
> > The word "negative revision" isn't correct, 
> 
> Why do you think so? The full phrase is "negative revision number",
> isn't it?

I don't think {negrev} is a revision number. It's merely an offset from
the tip. The help says "A plain integer is treated as a revision number.
Negative integers are treated as sequential offsets from the tip."

> > There are two weird cases:
> > 
> >  -r 'wdir()' => not negative
> >  -r null => unsupported negative integer (out of range)
> > 
> > Maybe return None for these?
> 
> Oh, these are also broken for the normal {rev} template keyword.

No. {rev} returns a valid revision number. 'rev(-1)' and 'rev(2147483647)'
work if these revisions are populated by e.g. 'null:wdir() & ...'.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to