Mercurial > hg-stable
diff mercurial/revsetlang.py @ 41576:1c04894e8fe1
revset: allow to parse single integer as a range
Even though this wouldn't be any useful in followlines(), it helps to unify
range processing.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 27 Jan 2019 13:28:45 +0900 |
parents | 59638c6fcb70 |
children | ddb174511f1b |
line wrap: on
line diff
--- a/mercurial/revsetlang.py Sun Jan 27 13:18:53 2019 +0900 +++ b/mercurial/revsetlang.py Sun Jan 27 13:28:45 2019 +0900 @@ -246,6 +246,9 @@ If any of the sides omitted, and if no default provided, ParseError will be raised. """ + if x and (x[0] == 'string' or x[0] == 'symbol'): + n = getinteger(x, err1) + return n, n a, b = getrange(x, err1) return getinteger(a, err2, deffirst), getinteger(b, err2, deflast)