revset: added _intlist method to replace _list for %ld
Now %ld expression goes through _intlist and doesn't do any unnecesary
processing anymore.
--- a/mercurial/revset.py Mon Feb 24 18:50:29 2014 -0600
+++ b/mercurial/revset.py Wed Feb 26 12:36:36 2014 -0800
@@ -1580,6 +1580,15 @@
s = subset.set()
return baseset([r for r in ls if r in s])
+# for internal use
+def _intlist(repo, subset, x):
+ s = getstring(x, "internal error")
+ if not s:
+ return baseset([])
+ ls = [int(r) for r in s.split('\0')]
+ s = subset.set()
+ return baseset([r for r in ls if r in s])
+
symbols = {
"adds": adds,
"all": getall,
@@ -1647,6 +1656,7 @@
"user": user,
"unstable": unstable,
"_list": _list,
+ "_intlist": _intlist,
}
# symbols which can't be used for a DoS attack for any given input
@@ -1717,6 +1727,7 @@
"user",
"unstable",
"_list",
+ "_intlist",
])
methods = {
@@ -2023,7 +2034,7 @@
elif l == 1:
return argtype(t, s[0])
elif t == 'd':
- return "_list('%s')" % "\0".join(str(int(a)) for a in s)
+ return "_intlist('%s')" % "\0".join(str(int(a)) for a in s)
elif t == 's':
return "_list('%s')" % "\0".join(s)
elif t == 'n':