Repository navigation
[Gecko Bug 1369941] Replace single integers N in fuzzy() and fuzzy-if() with 0-N ranges. - #12387
Merged
Merged
Conversation
This patch was written entirely by the following script:
#!/bin/bash
if [ ! -d "./.hg" ]
then
echo "Not in a source tree." 1>&2
exit 1
fi
find . -regex '.*\(ref\|crash\)test.*\.list' | while read FILENAME
do
echo "Processing ${FILENAME}."
# The following has four substitutions:
# * The first one replaces the *first* argument to fuzzy() when it doesn't
# have a - in it, by replacing it with an explicit 0-N range.
# * The second one does the same for the *second* argument to fuzzy().
# * The third does the same for the *second* argument to fuzzy-if().
# * The fourth does the same for the *third* argument to fuzzy-if().
#
# Note that this is using perl rather than sed because perl doesn't
# support non-greedy matching, which is needed for the first argument to
# fuzzy-if.
perl -pi -e 's/(fuzzy\()([^ ,()-]*)(,[^ ,()]*\))/${1}0-${2}${3}/g;s/(fuzzy\([^ ,()]*,)([^ ,()-]*)(\))/${1}0-${2}${3}/g;s/(fuzzy-if\([^ ]*?,)([^ ,()-]*)(,[^ ,()]*\))/${1}0-${2}${3}/g;s/(fuzzy-if\([^ ]*?,[^ ,()]*,)([^ ,()-]*)(\))/${1}0-${2}${3}/g' "${FILENAME}"
done
Differential Revision: https://phabricator.services.mozilla.com/D2974
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1369941
gecko-commit: e3a6f64071f2f1f82da639a7d09749839d5f053b
gecko-integration-branch: autoland
gecko-reviewers: dholbert
wpt-pr-bot
approved these changes
Aug 9, 2018
wpt-pr-bot
left a comment
Collaborator
There was a problem hiding this comment.
Already reviewed downstream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch was written entirely by the following script:
#!/bin/bash
if [ ! -d "./.hg" ]
then
echo "Not in a source tree." 1>&2
exit 1
fi
find . -regex '.(ref|crash)test..list' | while read FILENAME
do
echo "Processing ${FILENAME}."
# The following has four substitutions:
# * The first one replaces the first argument to fuzzy() when it doesn't
# have a - in it, by replacing it with an explicit 0-N range.
# * The second one does the same for the second argument to fuzzy().
# * The third does the same for the second argument to fuzzy-if().
# * The fourth does the same for the third argument to fuzzy-if().
#
# Note that this is using perl rather than sed because perl doesn't
# support non-greedy matching, which is needed for the first argument to
# fuzzy-if.
perl -pi -e 's/(fuzzy()([^ ,()-])(,[^ ,()]))/${1}0-${2}${3}/g;s/(fuzzy([^ ,()],)([^ ,()-])())/${1}0-${2}${3}/g;s/(fuzzy-if([^ ]?,)([^ ,()-])(,[^ ,()]))/${1}0-${2}${3}/g;s/(fuzzy-if([^ ]?,[^ ,()],)([^ ,()-])())/${1}0-${2}${3}/g' "${FILENAME}"
done
Differential Revision: https://phabricator.services.mozilla.com/D2974
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1369941
gecko-commit: e3a6f64071f2f1f82da639a7d09749839d5f053b
gecko-integration-branch: autoland
gecko-reviewers: dholbert