comparison mercurial/revset.py @ 24031:fe1abb5d92f6

revset: have rev() validate input by repo.changelog.__contains__() fullreposet.__contains__() will be rewritten in order to support "null" revision, and "rev()" won't be possible to rely on it. This backs out eb763217152a, but there is no performance regression now. revisions: 0) e1dbe0b215ae "l not in fullreposet(repo)" 1) this patch "l not in repo.changelog" revset #0: rev(210000) 0) wall 0.000056 comb 0.000000 user 0.000000 sys 0.000000 (best of 48036) 1) wall 0.000049 comb 0.000000 user 0.000000 sys 0.000000 (best of 54969)
author Yuya Nishihara <yuya@tcha.org>
date Wed, 04 Feb 2015 21:37:06 +0900
parents bc75f8750cde
children fafd9a1284cf
comparison
equal deleted inserted replaced
24030:828dc8db5515 24031:fe1abb5d92f6
1545 # i18n: "rev" is a keyword 1545 # i18n: "rev" is a keyword
1546 l = int(getstring(l[0], _("rev requires a number"))) 1546 l = int(getstring(l[0], _("rev requires a number")))
1547 except (TypeError, ValueError): 1547 except (TypeError, ValueError):
1548 # i18n: "rev" is a keyword 1548 # i18n: "rev" is a keyword
1549 raise error.ParseError(_("rev expects a number")) 1549 raise error.ParseError(_("rev expects a number"))
1550 if l not in fullreposet(repo) and l != node.nullrev: 1550 if l not in repo.changelog and l != node.nullrev:
1551 return baseset() 1551 return baseset()
1552 return subset & baseset([l]) 1552 return subset & baseset([l])
1553 1553
1554 def matching(repo, subset, x): 1554 def matching(repo, subset, x):
1555 """``matching(revision [, field])`` 1555 """``matching(revision [, field])``