changeset 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 828dc8db5515
children c53bc2e52514
files mercurial/revset.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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])