<commit_before># coding=utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

"""Known broken changeset ranges of SpiderMonkey are specified in this file.
"""

from __future__ import absolute_import, print_function

import subprocess

# pylint issue 73 https://git.io/vQAhf
from distutils.version import StrictVersion  # pylint: disable=import-error,no-name-in-module

from ..util import subprocesses as sps


def hgrange(first_bad, first_good):  # pylint: disable=missing-param-doc,missing-return-doc,missing-return-type-doc
    # pylint: disable=missing-type-doc
    """Like "first_bad::first_good", but includes branches/csets that never got the first_good fix."""
    # NB: mercurial's descendants(x) includes x
    # So this revset expression includes first_bad, but does not include first_good.
    # NB: hg log -r "(descendants(id(badddddd)) - descendants(id(baddddddd)))" happens to return the empty set,
    # like we want"
    return '(descendants(id(' + first_bad + '))-descendants(id(' + first_good + ')))'


def known_broken_ranges(options):  # pylint: disable=missing-param-doc,missing-return-doc,missing-return-type-doc
    # pylint: disable=missing-type-doc
    """Return a list of revsets corresponding to known-busted revisions."""
    # Paste numbers into: https://hg.mozilla.org/mozilla-central/rev/<number> to get hgweb link.
    # To add to the list:
    # - (1) will tell you when the brokenness started
    # - (1) python -m funfuzz.autobisectjs.autobisectjs --compilationFailedLabel=bad -e FAILINGREV
    # - (2) will tell you when the brokenness ended
    # - (2) python -m funfuzz.autobisectjs.autobisectjs --compilationFailedLabel=bad -s FAILINGREV

    # ANCIENT FIXME: It might make sense to avoid (or note) these in checkBlameParents.

    skips = [
        hgrange('7c25be97325d', 'd426154dd31d'),  # Fx38, broken spidermonkey
        hgrange('da286f0f7a49', '62fecc6ab96e'),  # Fx39, broken spidermonkey
        hgrange('8a416fedec44', '7f9252925e26'),  # Fx41, broken spidermonkey
        hgrange('3bcc3881b95d', 'c609df6d3895'),  # Fx44, broken spidermonkey
        hgrange('d3a026933bce', '5fa834fe9b96'),  # Fx52, broken spidermonkey
    ]

    if sps.isLinux:
        skips.extend([
            # Clang failure - probably recent versions of GCC as well.
            hgrange('5232dd059c11', 'ed98e1b9168d'),  # Fx41, see bug 1140482
        ])
        if not options.disableProfiling:
            skips.extend([
                # To bypass the following month-long breakage, use "--disable-profiling"
                hgrange('aa1da5ed8a07', '5a03382283ae'),  # Fx54-55, see bug 1339190<commit_msg>Add known broken range for SpiderMonkey.<commit_after># coding=utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

"""Known broken changeset ranges of SpiderMonkey are specified in this file.
"""

from __future__ import absolute_import, print_function

import subprocess

# pylint issue 73 https://git.io/vQAhf
from distutils.version import StrictVersion  # pylint: disable=import-error,no-name-in-module

from ..util import subprocesses as sps


def hgrange(first_bad, first_good):  # pylint: disable=missing-param-doc,missing-return-doc,missing-return-type-doc
    # pylint: disable=missing-type-doc
    """Like "first_bad::first_good", but includes branches/csets that never got the first_good fix."""
    # NB: mercurial's descendants(x) includes x
    # So this revset expression includes first_bad, but does not include first_good.
    # NB: hg log -r "(descendants(id(badddddd)) - descendants(id(baddddddd)))" happens to return the empty set,
    # like we want"
    return '(descendants(id(' + first_bad + '))-descendants(id(' + first_good + ')))'


def known_broken_ranges(options):  # pylint: disable=missing-param-doc,missing-return-doc,missing-return-type-doc
    # pylint: disable=missing-type-doc
    """Return a list of revsets corresponding to known-busted revisions."""
    # Paste numbers into: https://hg.mozilla.org/mozilla-central/rev/<number> to get hgweb link.
    # To add to the list:
    # - (1) will tell you when the brokenness started
    # - (1) python -m funfuzz.autobisectjs.autobisectjs --compilationFailedLabel=bad -e FAILINGREV
    # - (2) will tell you when the brokenness ended
    # - (2) python -m funfuzz.autobisectjs.autobisectjs --compilationFailedLabel=bad -s FAILINGREV

    # ANCIENT FIXME: It might make sense to avoid (or note) these in checkBlameParents.

    skips = [
        hgrange('7c25be97325d', 'd426154dd31d'),  # Fx38, broken spidermonkey
        hgrange('da286f0f7a49', '62fecc6ab96e'),  # Fx39, broken spidermonkey
        hgrange('8a416fedec44', '7f9252925e26'),  # Fx41, broken spidermonkey
        hgrange('3bcc3881b95d', 'c609df6d3895'),  # Fx44, broken spidermonkey
        hgrange('d3a026933bce', '5fa834fe9b96'),  # Fx52, broken spidermonkey
        hgrange("4c72627cfc6c", "926f80f2c5cc"),  # Fx60, broken spidermonkey
    ]

    if sps.isLinux:
        skips.extend([
            # Clang failure - probably recent versions of GCC as well.
            hgrange('5232dd059c11', 'ed98e1b9168d'),  # Fx41, see bug 1140482
        ])
        if not options.disableProfiling:
            skips.extend([
                # To bypass the following month-long breakage, use "--disable-profiling"
                hgrange('aa1da5ed8a07', '5a03382283ae'),  # Fx54-55, see bug 1339190
{'fraction_non_alphanumeric': 0.10997712475805033, 'fraction_numerical': 0.05349287348231568, 'mean_word_length': 3.511111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '825039', 'n_tokens_mistral': 2139, 'n_tokens_neox': 1917, 'n_words': 523}