Show More
@@ -1589,6 +1589,16 b' def _intlist(repo, subset, x):' | |||||
1589 | s = subset.set() |
|
1589 | s = subset.set() | |
1590 | return baseset([r for r in ls if r in s]) |
|
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 | symbols = { |
|
1602 | symbols = { | |
1593 | "adds": adds, |
|
1603 | "adds": adds, | |
1594 | "all": getall, |
|
1604 | "all": getall, | |
@@ -1657,6 +1667,7 b' symbols = {' | |||||
1657 | "unstable": unstable, |
|
1667 | "unstable": unstable, | |
1658 | "_list": _list, |
|
1668 | "_list": _list, | |
1659 | "_intlist": _intlist, |
|
1669 | "_intlist": _intlist, | |
|
1670 | "_hexlist": _hexlist, | |||
1660 | } |
|
1671 | } | |
1661 |
|
1672 | |||
1662 | # symbols which can't be used for a DoS attack for any given input |
|
1673 | # symbols which can't be used for a DoS attack for any given input | |
@@ -1728,6 +1739,7 b' safesymbols = set([' | |||||
1728 | "unstable", |
|
1739 | "unstable", | |
1729 | "_list", |
|
1740 | "_list", | |
1730 | "_intlist", |
|
1741 | "_intlist", | |
|
1742 | "_hexlist", | |||
1731 | ]) |
|
1743 | ]) | |
1732 |
|
1744 | |||
1733 | methods = { |
|
1745 | methods = { | |
@@ -2038,7 +2050,7 b' def formatspec(expr, *args):' | |||||
2038 | elif t == 's': |
|
2050 | elif t == 's': | |
2039 | return "_list('%s')" % "\0".join(s) |
|
2051 | return "_list('%s')" % "\0".join(s) | |
2040 | elif t == 'n': |
|
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 | elif t == 'b': |
|
2054 | elif t == 'b': | |
2043 | return "_list('%s')" % "\0".join(a.branch() for a in s) |
|
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