revset: have rev() validate input by repo.changelog.__contains__()
authorYuya Nishihara <yuya@tcha.org>
Wed, 04 Feb 2015 21:37:06 +0900
changeset 24031 fe1abb5d92f6
parent 24030 828dc8db5515
child 24032 c53bc2e52514
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)
mercurial/revset.py
--- a/mercurial/revset.py	Wed Feb 04 21:25:57 2015 +0900
+++ b/mercurial/revset.py	Wed Feb 04 21:37:06 2015 +0900
@@ -1547,7 +1547,7 @@
     except (TypeError, ValueError):
         # i18n: "rev" is a keyword
         raise error.ParseError(_("rev expects a number"))
-    if l not in fullreposet(repo) and l != node.nullrev:
+    if l not in repo.changelog and l != node.nullrev:
         return baseset()
     return subset & baseset([l])