~ubuntu-branches/ubuntu/wily/mercurial/wily

« back to all changes in this revision

Viewing changes to mercurial/revset.py

  • Committer: Package Import Robot
  • Author(s): Javi Merino
  • Date: 2013-11-01 23:19:57 UTC
  • mfrom: (1.2.38) (9.1.16 experimental)
  • Revision ID: package-import@ubuntu.com-20131101231957-hs70pwpinavlz3t6
Tags: 2.8-1
* New upstream release
* Fix mercurial-git and hgsubversion autopkgtest by loading the
  appropriate extension
* Bump standards-version to 3.9.5 (no change needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1599
1599
    "_list": _list,
1600
1600
}
1601
1601
 
 
1602
# symbols which can't be used for a DoS attack for any given input
 
1603
# (e.g. those which accept regexes as plain strings shouldn't be included)
 
1604
# functions that just return a lot of changesets (like all) don't count here
 
1605
safesymbols = set([
 
1606
    "adds",
 
1607
    "all",
 
1608
    "ancestor",
 
1609
    "ancestors",
 
1610
    "_firstancestors",
 
1611
    "author",
 
1612
    "bisect",
 
1613
    "bisected",
 
1614
    "bookmark",
 
1615
    "branch",
 
1616
    "branchpoint",
 
1617
    "bumped",
 
1618
    "bundle",
 
1619
    "children",
 
1620
    "closed",
 
1621
    "converted",
 
1622
    "date",
 
1623
    "desc",
 
1624
    "descendants",
 
1625
    "_firstdescendants",
 
1626
    "destination",
 
1627
    "divergent",
 
1628
    "draft",
 
1629
    "extinct",
 
1630
    "extra",
 
1631
    "file",
 
1632
    "filelog",
 
1633
    "first",
 
1634
    "follow",
 
1635
    "_followfirst",
 
1636
    "head",
 
1637
    "heads",
 
1638
    "hidden",
 
1639
    "id",
 
1640
    "keyword",
 
1641
    "last",
 
1642
    "limit",
 
1643
    "_matchfiles",
 
1644
    "max",
 
1645
    "merge",
 
1646
    "min",
 
1647
    "modifies",
 
1648
    "obsolete",
 
1649
    "origin",
 
1650
    "outgoing",
 
1651
    "p1",
 
1652
    "p2",
 
1653
    "parents",
 
1654
    "present",
 
1655
    "public",
 
1656
    "remote",
 
1657
    "removes",
 
1658
    "rev",
 
1659
    "reverse",
 
1660
    "roots",
 
1661
    "sort",
 
1662
    "secret",
 
1663
    "matching",
 
1664
    "tag",
 
1665
    "tagged",
 
1666
    "user",
 
1667
    "unstable",
 
1668
    "_list",
 
1669
])
 
1670
 
1602
1671
methods = {
1603
1672
    "range": rangeset,
1604
1673
    "dagrange": dagrange,
1935
2004
    output = '\n'.join(('  '*l + s) for l, s in lines)
1936
2005
    return output
1937
2006
 
 
2007
def depth(tree):
 
2008
    if isinstance(tree, tuple):
 
2009
        return max(map(depth, tree)) + 1
 
2010
    else:
 
2011
        return 0
 
2012
 
 
2013
def funcsused(tree):
 
2014
    if not isinstance(tree, tuple) or tree[0] in ('string', 'symbol'):
 
2015
        return set()
 
2016
    else:
 
2017
        funcs = set()
 
2018
        for s in tree[1:]:
 
2019
            funcs |= funcsused(s)
 
2020
        if tree[0] == 'func':
 
2021
            funcs.add(tree[1][1])
 
2022
        return funcs
 
2023
 
1938
2024
# tell hggettext to extract docstrings from these functions:
1939
2025
i18nfunctions = symbols.values()