##// END OF EJS Templates
revset: added _intlist method to replace _list for %ld...
Lucas Moscovicz -
r20566:98024950 default
parent child Browse files
Show More
@@ -1580,6 +1580,15 b' def _list(repo, subset, x):'
1580 s = subset.set()
1580 s = subset.set()
1581 return baseset([r for r in ls if r in s])
1581 return baseset([r for r in ls if r in s])
1582
1582
1583 # for internal use
1584 def _intlist(repo, subset, x):
1585 s = getstring(x, "internal error")
1586 if not s:
1587 return baseset([])
1588 ls = [int(r) for r in s.split('\0')]
1589 s = subset.set()
1590 return baseset([r for r in ls if r in s])
1591
1583 symbols = {
1592 symbols = {
1584 "adds": adds,
1593 "adds": adds,
1585 "all": getall,
1594 "all": getall,
@@ -1647,6 +1656,7 b' symbols = {'
1647 "user": user,
1656 "user": user,
1648 "unstable": unstable,
1657 "unstable": unstable,
1649 "_list": _list,
1658 "_list": _list,
1659 "_intlist": _intlist,
1650 }
1660 }
1651
1661
1652 # symbols which can't be used for a DoS attack for any given input
1662 # symbols which can't be used for a DoS attack for any given input
@@ -1717,6 +1727,7 b' safesymbols = set(['
1717 "user",
1727 "user",
1718 "unstable",
1728 "unstable",
1719 "_list",
1729 "_list",
1730 "_intlist",
1720 ])
1731 ])
1721
1732
1722 methods = {
1733 methods = {
@@ -2023,7 +2034,7 b' def formatspec(expr, *args):'
2023 elif l == 1:
2034 elif l == 1:
2024 return argtype(t, s[0])
2035 return argtype(t, s[0])
2025 elif t == 'd':
2036 elif t == 'd':
2026 return "_list('%s')" % "\0".join(str(int(a)) for a in s)
2037 return "_intlist('%s')" % "\0".join(str(int(a)) for a in s)
2027 elif t == 's':
2038 elif t == 's':
2028 return "_list('%s')" % "\0".join(s)
2039 return "_list('%s')" % "\0".join(s)
2029 elif t == 'n':
2040 elif t == 'n':
General Comments 0
You need to be logged in to leave comments. Login now