##// END OF EJS Templates
revset: added _hexlist method to replace _list for %ln...
Lucas Moscovicz -
r20569:0d4be103 default
parent child Browse files
Show More
@@ -1589,6 +1589,16 b' def _intlist(repo, subset, x):'
1589 1589 s = subset.set()
1590 1590 return baseset([r for r in ls if r in s])
1591 1591
1592 # for internal use
1593 def _hexlist(repo, subset, x):
1594 s = getstring(x, "internal error")
1595 if not s:
1596 return baseset([])
1597 cl = repo.changelog
1598 ls = [cl.rev(node.bin(r)) for r in s.split('\0')]
1599 s = subset.set()
1600 return baseset([r for r in ls if r in s])
1601
1592 1602 symbols = {
1593 1603 "adds": adds,
1594 1604 "all": getall,
@@ -1657,6 +1667,7 b' symbols = {'
1657 1667 "unstable": unstable,
1658 1668 "_list": _list,
1659 1669 "_intlist": _intlist,
1670 "_hexlist": _hexlist,
1660 1671 }
1661 1672
1662 1673 # symbols which can't be used for a DoS attack for any given input
@@ -1728,6 +1739,7 b' safesymbols = set(['
1728 1739 "unstable",
1729 1740 "_list",
1730 1741 "_intlist",
1742 "_hexlist",
1731 1743 ])
1732 1744
1733 1745 methods = {
@@ -2038,7 +2050,7 b' def formatspec(expr, *args):'
2038 2050 elif t == 's':
2039 2051 return "_list('%s')" % "\0".join(s)
2040 2052 elif t == 'n':
2041 return "_list('%s')" % "\0".join(node.hex(a) for a in s)
2053 return "_hexlist('%s')" % "\0".join(node.hex(a) for a in s)
2042 2054 elif t == 'b':
2043 2055 return "_list('%s')" % "\0".join(a.branch() for a in s)
2044 2056
General Comments 0
You need to be logged in to leave comments. Login now