comparison mercurial/revset.py @ 44590:482a6aac1f15

revset: allow repo.revs('%d', wdirrev) Otherwise we can't write repo.revs('null:%d', subset.max()) to build a smartset covering the range {null .. tip} + {wdir} if subset includes wdir.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 21 Mar 2020 13:27:47 +0900
parents 9d2b2df2c2ba
children 967e2e81f762
comparison
equal deleted inserted replaced
44589:b746a22349f9 44590:482a6aac1f15
2106 # i18n: "rev" is a keyword 2106 # i18n: "rev" is a keyword
2107 l = int(getstring(l[0], _(b"rev requires a number"))) 2107 l = int(getstring(l[0], _(b"rev requires a number")))
2108 except (TypeError, ValueError): 2108 except (TypeError, ValueError):
2109 # i18n: "rev" is a keyword 2109 # i18n: "rev" is a keyword
2110 raise error.ParseError(_(b"rev expects a number")) 2110 raise error.ParseError(_(b"rev expects a number"))
2111 repo.changelog.node(l) # check that the rev exists 2111 if l not in _virtualrevs:
2112 repo.changelog.node(l) # check that the rev exists
2112 return subset & baseset([l]) 2113 return subset & baseset([l])
2113 2114
2114 2115
2115 @predicate(b'revset(set)', safe=True, takeorder=True) 2116 @predicate(b'revset(set)', safe=True, takeorder=True)
2116 def revsetpredicate(repo, subset, x, order): 2117 def revsetpredicate(repo, subset, x, order):