<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[277735] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/277735">277735</a></dd>
<dt>Author</dt> <dd>jbedard@apple.com</dd>
<dt>Date</dt> <dd>2021-05-19 11:09:45 -0700 (Wed, 19 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[webkitpy] Deprecate webkitpy/tool/grammar.py
https://bugs.webkit.org/show_bug.cgi?id=225943
<rdar://problem/78180111>

Reviewed by Stephanie Lewis.

* Scripts/bisect-builds:
* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(LayoutTestRunner.run_tests):
* Scripts/webkitpy/layout_tests/controllers/manager.py:
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer.print_found):
(Printer.print_workers_and_shards):
(Printer._print_one_line_summary):
* Scripts/webkitpy/test/printer.py:
* Scripts/webkitpy/tool/bot/flakytestreporter.py:
(FlakyTestReporter._lookup_bug_for_flaky_test):
(FlakyTestReporter._create_bug_for_flaky_test):
* Scripts/webkitpy/tool/commands/download.py:
(AbstractPatchProcessingCommand.execute):
(ProcessBugsMixin._fetch_list_of_patches_to_process):
(ProcessURLsMixin._fetch_list_of_patches_to_process):
* Scripts/webkitpy/tool/commands/download_unittest.py:
* Scripts/webkitpy/tool/commands/queries.py:
* Scripts/webkitpy/tool/commands/suggestnominations.py:
(SuggestNominations._print_nominations):
(SuggestNominations._print_counts):
* Scripts/webkitpy/tool/commands/upload.py:
(CleanPendingCommit._flags_to_clear_on_patch):
(PostCommits.execute):
* Scripts/webkitpy/tool/grammar.py: Removed.
* Scripts/webkitpy/tool/grammar_unittest.py: Removed.
* Scripts/webkitpy/tool/multicommandtool.py:
* Scripts/webkitpy/tool/steps/obsoletepatches.py:
(ObsoletePatches.run):
* Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
(PrepareChangeLogForRevert._message_for_revert):
* Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py:
* Scripts/webkitpy/tool/steps/reopenbugafterrevert.py:
(ReopenBugAfterRevert.run):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptsbisectbuilds">trunk/Tools/Scripts/bisect-builds</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testscontrollerslayout_test_runnerpy">trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testscontrollersmanagerpy">trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsviewsprintingpy">trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytestprinterpy">trunk/Tools/Scripts/webkitpy/test/printer.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolbotflakytestreporterpy">trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolcommandsdownloadpy">trunk/Tools/Scripts/webkitpy/tool/commands/download.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolcommandsdownload_unittestpy">trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolcommandsqueriespy">trunk/Tools/Scripts/webkitpy/tool/commands/queries.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolcommandssuggestnominationspy">trunk/Tools/Scripts/webkitpy/tool/commands/suggestnominations.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolcommandsuploadpy">trunk/Tools/Scripts/webkitpy/tool/commands/upload.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolmulticommandtoolpy">trunk/Tools/Scripts/webkitpy/tool/multicommandtool.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolstepsobsoletepatchespy">trunk/Tools/Scripts/webkitpy/tool/steps/obsoletepatches.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolstepspreparechangelogforrevertpy">trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolstepspreparechangelogforrevert_unittestpy">trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolstepsreopenbugafterrevertpy">trunk/Tools/Scripts/webkitpy/tool/steps/reopenbugafterrevert.py</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkToolsScriptswebkitpytoolgrammarpy">trunk/Tools/Scripts/webkitpy/tool/grammar.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolgrammar_unittestpy">trunk/Tools/Scripts/webkitpy/tool/grammar_unittest.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/ChangeLog       2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2021-05-19  Jonathan Bedard  <jbedard@apple.com>
+
+        [webkitpy] Deprecate webkitpy/tool/grammar.py
+        https://bugs.webkit.org/show_bug.cgi?id=225943
+        <rdar://problem/78180111>
+
+        Reviewed by Stephanie Lewis.
+
+        * Scripts/bisect-builds:
+        * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
+        (LayoutTestRunner.run_tests):
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        * Scripts/webkitpy/layout_tests/views/printing.py:
+        (Printer.print_found):
+        (Printer.print_workers_and_shards):
+        (Printer._print_one_line_summary):
+        * Scripts/webkitpy/test/printer.py:
+        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
+        (FlakyTestReporter._lookup_bug_for_flaky_test):
+        (FlakyTestReporter._create_bug_for_flaky_test):
+        * Scripts/webkitpy/tool/commands/download.py:
+        (AbstractPatchProcessingCommand.execute):
+        (ProcessBugsMixin._fetch_list_of_patches_to_process):
+        (ProcessURLsMixin._fetch_list_of_patches_to_process):
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+        * Scripts/webkitpy/tool/commands/queries.py:
+        * Scripts/webkitpy/tool/commands/suggestnominations.py:
+        (SuggestNominations._print_nominations):
+        (SuggestNominations._print_counts):
+        * Scripts/webkitpy/tool/commands/upload.py:
+        (CleanPendingCommit._flags_to_clear_on_patch):
+        (PostCommits.execute):
+        * Scripts/webkitpy/tool/grammar.py: Removed.
+        * Scripts/webkitpy/tool/grammar_unittest.py: Removed.
+        * Scripts/webkitpy/tool/multicommandtool.py:
+        * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+        (ObsoletePatches.run):
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+        (PrepareChangeLogForRevert._message_for_revert):
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py:
+        * Scripts/webkitpy/tool/steps/reopenbugafterrevert.py:
+        (ReopenBugAfterRevert.run):
+
</ins><span class="cx"> 2021-05-19  Jonathan Bedard  <JonWBedard@gmail.com>
</span><span class="cx"> 
</span><span class="cx">         [webkitscmpy] Apply logging options to every command
</span></span></pre></div>
<a id="trunkToolsScriptsbisectbuilds"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/bisect-builds (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/bisect-builds        2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/bisect-builds   2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -30,8 +30,9 @@
</span><span class="cx"> from webkitpy.common.memoized import memoized
</span><span class="cx"> from webkitpy.common.system.systemhost import SystemHost
</span><span class="cx"> from webkitpy.common.version_name_map import VersionNameMap
</span><del>-from webkitpy.tool.grammar import pluralize
</del><span class="cx"> 
</span><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> import argparse
</span><span class="cx"> import bisect
</span><span class="cx"> import json
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testscontrollerslayout_test_runnerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py      2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py 2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> import threading
</span><span class="cx"> import time
</span><span class="cx"> 
</span><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> from webkitpy.common import message_pool
</span><span class="cx"> from webkitpy.common.iteration_compatibility import iteritems
</span><span class="cx"> from webkitpy.layout_tests.controllers import single_test_runner
</span><span class="lines">@@ -38,7 +40,6 @@
</span><span class="cx"> from webkitpy.layout_tests.models import test_expectations
</span><span class="cx"> from webkitpy.layout_tests.models import test_failures
</span><span class="cx"> from webkitpy.layout_tests.models import test_results
</span><del>-from webkitpy.tool import grammar
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="lines">@@ -114,7 +115,7 @@
</span><span class="cx">         if self._options.dry_run:
</span><span class="cx">             return run_results
</span><span class="cx"> 
</span><del>-        self._printer.write_update('Starting %s ...' % grammar.pluralize(num_workers, "worker"))
</del><ins>+        self._printer.write_update('Starting %s ...' % pluralize(num_workers, "worker"))
</ins><span class="cx"> 
</span><span class="cx">         try:
</span><span class="cx">             with message_pool.get(self, self._worker_factory, num_workers, self._port.worker_startup_delay_secs(), self._port.host) as pool:
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testscontrollersmanagerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py    2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -42,6 +42,8 @@
</span><span class="cx"> import time
</span><span class="cx"> from collections import defaultdict, OrderedDict
</span><span class="cx"> 
</span><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> from webkitpy.common.iteration_compatibility import iteritems, itervalues
</span><span class="cx"> from webkitpy.layout_tests.controllers.layout_test_finder import LayoutTestFinder
</span><span class="cx"> from webkitpy.layout_tests.controllers.layout_test_runner import LayoutTestRunner
</span><span class="lines">@@ -54,7 +56,6 @@
</span><span class="cx"> from webkitpy.layout_tests.models import test_run_results
</span><span class="cx"> from webkitpy.layout_tests.models.test_input import TestInput
</span><span class="cx"> from webkitpy.layout_tests.models.test_run_results import INTERRUPTED_EXIT_STATUS, TestRunResults
</span><del>-from webkitpy.tool.grammar import pluralize
</del><span class="cx"> from webkitpy.results.upload import Upload
</span><span class="cx"> from webkitpy.xcode.device_type import DeviceType
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsviewsprintingpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py      2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/views/printing.py 2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -31,7 +31,8 @@
</span><span class="cx"> import math
</span><span class="cx"> import optparse
</span><span class="cx"> 
</span><del>-from webkitpy.tool import grammar
</del><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> from webkitpy.layout_tests.models import test_expectations
</span><span class="cx"> from webkitpy.layout_tests.views.metered_stream import MeteredStream
</span><span class="cx"> 
</span><span class="lines">@@ -107,9 +108,9 @@
</span><span class="cx">         self._print_default('')
</span><span class="cx"> 
</span><span class="cx">     def print_found(self, num_all_test_files, num_to_run, repeat_each, iterations):
</span><del>-        found_str = 'Found %s; running %d' % (grammar.pluralize(num_all_test_files, "test"), num_to_run)
</del><ins>+        found_str = 'Found %s; running %d' % (pluralize(num_all_test_files, "test"), num_to_run)
</ins><span class="cx">         if repeat_each * iterations > 1:
</span><del>-            found_str += ' (%s each: --repeat-each=%d --iterations=%d)' % (grammar.pluralize(repeat_each * iterations, "time"), repeat_each, iterations)
</del><ins>+            found_str += ' (%s each: --repeat-each=%d --iterations=%d)' % (pluralize(repeat_each * iterations, "time"), repeat_each, iterations)
</ins><span class="cx">         found_str += ', skipping %d' % (num_all_test_files - num_to_run)
</span><span class="cx">         self._print_default(found_str + '.')
</span><span class="cx"> 
</span><span class="lines">@@ -124,9 +125,9 @@
</span><span class="cx"> 
</span><span class="cx">         if num_workers == 1:
</span><span class="cx">             self._print_default('Running 1 {}.'.format(driver_name))
</span><del>-            self._print_debug('({}).'.format(grammar.pluralize(num_shards, "shard")))
</del><ins>+            self._print_debug('({}).'.format(pluralize(num_shards, "shard")))
</ins><span class="cx">         else:
</span><del>-            self._print_default('Running {} in parallel.'.format(grammar.pluralize(num_workers, driver_name)))
</del><ins>+            self._print_default('Running {} in parallel.'.format(pluralize(num_workers, driver_name)))
</ins><span class="cx">             self._print_debug('({} shards).'.format(num_shards))
</span><span class="cx">         self._print_default('')
</span><span class="cx"> 
</span><span class="lines">@@ -290,9 +291,9 @@
</span><span class="cx">                 else:
</span><span class="cx">                     summary = "The test ran as expected."
</span><span class="cx">             else:
</span><del>-                summary = "%s ran as expected%s." % (grammar.pluralize(expected, "test"), incomplete_str)
</del><ins>+                summary = "%s ran as expected%s." % (pluralize(expected, "test"), incomplete_str)
</ins><span class="cx">         else:
</span><del>-            summary = "%s ran as expected, %d didn't%s:" % (grammar.pluralize(expected, "test"), unexpected, incomplete_str)
</del><ins>+            summary = "%s ran as expected, %d didn't%s:" % (pluralize(expected, "test"), unexpected, incomplete_str)
</ins><span class="cx"> 
</span><span class="cx">         self._print_quiet(summary)
</span><span class="cx">         self._print_quiet("")
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytestprinterpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/test/printer.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/test/printer.py     2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/test/printer.py        2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -23,9 +23,10 @@
</span><span class="cx"> 
</span><span class="cx"> import logging
</span><span class="cx"> 
</span><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> from webkitpy.common.system.systemhost import SystemHost
</span><span class="cx"> from webkitpy.layout_tests.views.metered_stream import MeteredStream
</span><del>-from webkitpy.tool.grammar import pluralize
</del><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolbotflakytestreporterpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py       2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py  2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -29,11 +29,13 @@
</span><span class="cx"> import logging
</span><span class="cx"> import os.path
</span><span class="cx"> 
</span><ins>+from webkitcorepy import string_utils
+
</ins><span class="cx"> from webkitpy.common.net.layouttestresults import path_for_layout_test
</span><span class="cx"> from webkitpy.common.config import urls
</span><span class="cx"> from webkitpy.tool.bot.botinfo import BotInfo
</span><del>-from webkitpy.tool.grammar import plural, pluralize, join_with_separators
</del><span class="cx"> 
</span><ins>+
</ins><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -78,7 +80,7 @@
</span><span class="cx">         if len(bugs) > 1:
</span><span class="cx">             # FIXME: There are probably heuristics we could use for finding
</span><span class="cx">             # the right bug instead of the first, like open vs. closed.
</span><del>-            _log.warn("Found %s %s matching '%s' filed by a bot, using the first." % (pluralize(len(bugs), "bug"), [bug.id() for bug in bugs], flaky_test))
</del><ins>+            _log.warn("Found %s %s matching '%s' filed by a bot, using the first." % (string_utils.pluralize(len(bugs), "bug"), [bug.id() for bug in bugs], flaky_test))
</ins><span class="cx">         return bugs[0]
</span><span class="cx"> 
</span><span class="cx">     def _view_source_url_for_test(self, test_path):
</span><span class="lines">@@ -87,7 +89,7 @@
</span><span class="cx">     def _create_bug_for_flaky_test(self, flaky_test, author_emails, latest_flake_message):
</span><span class="cx">         format_values = {
</span><span class="cx">             'test': flaky_test,
</span><del>-            'authors': join_with_separators(sorted(author_emails)),
</del><ins>+            'authors': string_utils.join(sorted(author_emails)),
</ins><span class="cx">             'flake_message': latest_flake_message,
</span><span class="cx">             'test_url': self._view_source_url_for_test(flaky_test),
</span><span class="cx">             'bot_name': self._bot_name,
</span><span class="lines">@@ -118,8 +120,8 @@
</span><span class="cx">     def _optional_author_string(self, author_emails):
</span><span class="cx">         if not author_emails:
</span><span class="cx">             return ""
</span><del>-        heading_string = plural('author') if len(author_emails) > 1 else 'author'
-        authors_string = join_with_separators(sorted(author_emails))
</del><ins>+        heading_string = 'authors' if len(author_emails) > 1 else 'author'
+        authors_string = string_utils.join(sorted(author_emails))
</ins><span class="cx">         return " (%s: %s)" % (heading_string, authors_string)
</span><span class="cx"> 
</span><span class="cx">     def _latest_flake_message(self, flaky_result, patch):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolcommandsdownloadpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/commands/download.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/commands/download.py   2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/download.py      2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> 
</span><span class="cx"> from webkitpy.tool import steps
</span><span class="cx"> 
</span><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> from webkitpy.common.checkout.changelog import ChangeLog
</span><span class="cx"> from webkitpy.common.config import urls
</span><span class="cx"> from webkitpy.common.net.bugzilla import Bugzilla
</span><span class="lines">@@ -39,7 +41,6 @@
</span><span class="cx"> from webkitpy.tool.commands.deprecatedcommand import DeprecatedCommand
</span><span class="cx"> from webkitpy.tool.commands.stepsequence import StepSequence
</span><span class="cx"> from webkitpy.tool.comments import bug_comment_from_commit_text
</span><del>-from webkitpy.tool.grammar import pluralize
</del><span class="cx"> from webkitpy.tool.multicommandtool import Command
</span><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="lines">@@ -174,7 +175,7 @@
</span><span class="cx"> 
</span><span class="cx">         # It's nice to print out total statistics.
</span><span class="cx">         bugs_to_patches = self._collect_patches_by_bug(patches)
</span><del>-        _log.info("Processing %s from %s." % (pluralize(len(patches), "patch"), pluralize(len(bugs_to_patches), "bug")))
</del><ins>+        _log.info("Processing %s from %s." % (pluralize(len(patches), 'patch', plural='patches'), pluralize(len(bugs_to_patches), "bug")))
</ins><span class="cx"> 
</span><span class="cx">         for patch in patches:
</span><span class="cx">             self._process_patch(patch, options, args, tool)
</span><span class="lines">@@ -218,13 +219,13 @@
</span><span class="cx">         all_patches = []
</span><span class="cx">         for bug_id in args:
</span><span class="cx">             patches = tool.bugs.fetch_bug(bug_id).reviewed_patches()
</span><del>-            _log.info("%s found on bug %s." % (pluralize(len(patches), "reviewed patch"), bug_id))
</del><ins>+            _log.info("%s found on bug %s." % (pluralize(len(patches), 'reviewed patch', plural='reviewed patches'), bug_id))
</ins><span class="cx">             all_patches += patches
</span><span class="cx">         if not all_patches:
</span><span class="cx">             _log.info("No reviewed patches found, looking for unreviewed patches.")
</span><span class="cx">             for bug_id in args:
</span><span class="cx">                 patches = tool.bugs.fetch_bug(bug_id).patches()
</span><del>-                _log.info("%s found on bug %s." % (pluralize(len(patches), "patch"), bug_id))
</del><ins>+                _log.info("%s found on bug %s." % (pluralize(len(patches), 'patch', plural='patches'), bug_id))
</ins><span class="cx">                 all_patches += patches
</span><span class="cx">         return all_patches
</span><span class="cx"> 
</span><span class="lines">@@ -236,7 +237,7 @@
</span><span class="cx">             bug_id = urls.parse_bug_id(url)
</span><span class="cx">             if bug_id:
</span><span class="cx">                 patches = tool.bugs.fetch_bug(bug_id).patches()
</span><del>-                _log.info("%s found on bug %s." % (pluralize(len(patches), "patch"), bug_id))
</del><ins>+                _log.info("%s found on bug %s." % (pluralize(len(patches), 'patch', plural='patches'), bug_id))
</ins><span class="cx">                 all_patches += patches
</span><span class="cx"> 
</span><span class="cx">             attachment_id = urls.parse_attachment_id(url)
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolcommandsdownload_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py  2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py     2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -467,17 +467,17 @@
</span><span class="cx"> Was that diff correct?
</span><span class="cx"> Building WebKit
</span><span class="cx"> Committed r49824: <https://commits.webkit.org/r49824>
</span><del>-MOCK reopen_bug 50000 with comment 'Reverted r852, r963, and r3001 for reason:
</del><ins>+MOCK reopen_bug 50000 with comment 'Reverted r852, r963 and r3001 for reason:
</ins><span class="cx"> 
</span><span class="cx"> Reason
</span><span class="cx"> 
</span><span class="cx"> Committed r49824 (5@main): <https://commits.webkit.org/5@main>'
</span><del>-MOCK reopen_bug 50005 with comment 'Reverted r852, r963, and r3001 for reason:
</del><ins>+MOCK reopen_bug 50005 with comment 'Reverted r852, r963 and r3001 for reason:
</ins><span class="cx"> 
</span><span class="cx"> Reason
</span><span class="cx"> 
</span><span class="cx"> Committed r49824 (5@main): <https://commits.webkit.org/5@main>'
</span><del>-MOCK reopen_bug 50004 with comment 'Reverted r852, r963, and r3001 for reason:
</del><ins>+MOCK reopen_bug 50004 with comment 'Reverted r852, r963 and r3001 for reason:
</ins><span class="cx"> 
</span><span class="cx"> Reason
</span><span class="cx"> 
</span><span class="lines">@@ -495,12 +495,12 @@
</span><span class="cx"> Was that diff correct?
</span><span class="cx"> Building WebKit
</span><span class="cx"> Committed r49824: <https://commits.webkit.org/r49824>
</span><del>-MOCK reopen_bug 50000 with comment 'Reverted r852, r963, and r999 for reason:
</del><ins>+MOCK reopen_bug 50000 with comment 'Reverted r852, r963 and r999 for reason:
</ins><span class="cx"> 
</span><span class="cx"> Reason
</span><span class="cx"> 
</span><span class="cx"> Committed r49824 (5@main): <https://commits.webkit.org/5@main>'
</span><del>-MOCK reopen_bug 50005 with comment 'Reverted r852, r963, and r999 for reason:
</del><ins>+MOCK reopen_bug 50005 with comment 'Reverted r852, r963 and r999 for reason:
</ins><span class="cx"> 
</span><span class="cx"> Reason
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolcommandsqueriespy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queries.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/commands/queries.py    2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queries.py       2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -37,6 +37,8 @@
</span><span class="cx"> from datetime import datetime
</span><span class="cx"> from optparse import make_option
</span><span class="cx"> 
</span><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> from webkitpy.tool import steps
</span><span class="cx"> 
</span><span class="cx"> import webkitpy.common.config.urls as config_urls
</span><span class="lines">@@ -52,7 +54,6 @@
</span><span class="cx"> from webkitpy.port import platform_options, configuration_options
</span><span class="cx"> from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
</span><span class="cx"> from webkitpy.tool.commands.deprecatedcommand import DeprecatedCommand
</span><del>-from webkitpy.tool.grammar import pluralize
</del><span class="cx"> from webkitpy.tool.multicommandtool import Command
</span><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolcommandssuggestnominationspy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/commands/suggestnominations.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/commands/suggestnominations.py 2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/suggestnominations.py    2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -30,9 +30,10 @@
</span><span class="cx"> from optparse import make_option
</span><span class="cx"> import re
</span><span class="cx"> 
</span><ins>+from webkitcorepy import string_utils
+
</ins><span class="cx"> from webkitpy.common.checkout.changelog import ChangeLogEntry
</span><span class="cx"> from webkitpy.common.config.committers import CommitterList
</span><del>-from webkitpy.tool import grammar
</del><span class="cx"> from webkitpy.tool.multicommandtool import Command
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -249,7 +250,7 @@
</span><span class="cx"> 
</span><span class="cx">         for nomination in nominations:
</span><span class="cx">             # This is a little bit of a hack, but its convienent to just pass the nomination dictionary to the formating operator.
</span><del>-            nomination['roles_string'] = grammar.join_with_separators(nomination['roles']).upper()
</del><ins>+            nomination['roles_string'] = string_utils.join(nomination['roles']).upper()
</ins><span class="cx">             print("%(roles_string)s: %(author_name)s (%(author_email)s) has %(patch_count)s reviewed patches" % nomination)
</span><span class="cx">             counter = counters_by_email[nomination['author_email']]
</span><span class="cx"> 
</span><span class="lines">@@ -274,9 +275,9 @@
</span><span class="cx">             for alias in counter['emails']:
</span><span class="cx">                 alias_list.append(alias)
</span><span class="cx">             if alias_list:
</span><del>-                print("CONTRIBUTOR: %s (%s) has %s %s" % (author_name, author_email, grammar.pluralize(patch_count, "reviewed patch"), "(aliases: " + ", ".join(alias_list) + ")"))
</del><ins>+                print("CONTRIBUTOR: %s (%s) has %s %s" % (author_name, author_email, string_utils.pluralize(patch_count, 'reviewed patch', plural='reviewed patches'), "(aliases: " + ", ".join(alias_list) + ")"))
</ins><span class="cx">             else:
</span><del>-                print("CONTRIBUTOR: %s (%s) has %s" % (author_name, author_email, grammar.pluralize(patch_count, "reviewed patch")))
</del><ins>+                print("CONTRIBUTOR: %s (%s) has %s" % (author_name, author_email, string_utils.pluralize(patch_count, 'reviewed patch', plural='reviewed patches')))
</ins><span class="cx">         return
</span><span class="cx"> 
</span><span class="cx">     def execute(self, options, args, tool):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolcommandsuploadpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/commands/upload.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/commands/upload.py     2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/upload.py        2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx"> 
</span><span class="cx"> from webkitpy.tool import steps
</span><span class="cx"> 
</span><ins>+from webkitcorepy import string_utils
+
</ins><span class="cx"> from webkitpy.common.checkout.changelog import parse_bug_id_from_changelog
</span><span class="cx"> from webkitpy.common.config.committers import CommitterList
</span><span class="cx"> from webkitpy.common.system.user import User
</span><span class="lines">@@ -42,7 +44,6 @@
</span><span class="cx"> from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
</span><span class="cx"> from webkitpy.tool.commands.deprecatedcommand import DeprecatedCommand
</span><span class="cx"> from webkitpy.tool.comments import bug_comment_from_svn_revision
</span><del>-from webkitpy.tool.grammar import pluralize, join_with_separators
</del><span class="cx"> from webkitpy.tool.multicommandtool import Command
</span><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="lines">@@ -80,7 +81,7 @@
</span><span class="cx">                 what_was_cleared.append(u"%s's review+" % patch.reviewer().full_name)
</span><span class="cx">             else:
</span><span class="cx">                 what_was_cleared.append("review+")
</span><del>-        return join_with_separators(what_was_cleared)
</del><ins>+        return string_utils.join(what_was_cleared)
</ins><span class="cx"> 
</span><span class="cx">     def execute(self, options, args, tool):
</span><span class="cx">         for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
</span><span class="lines">@@ -347,7 +348,7 @@
</span><span class="cx">     def execute(self, options, args, tool):
</span><span class="cx">         commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
</span><span class="cx">         if len(commit_ids) > 10:  # We could lower this limit, 10 is too many for one bug as-is.
</span><del>-            _log.error("webkit-patch does not support attaching %s at once.  Are you sure you passed the right commit range?" % (pluralize(len(commit_ids), "patch")))
</del><ins>+            _log.error("webkit-patch does not support attaching %s at once.  Are you sure you passed the right commit range?" % (string_utils.pluralize(len(commit_ids), 'patch', plural='patches')))
</ins><span class="cx">             sys.exit(1)
</span><span class="cx"> 
</span><span class="cx">         have_obsoleted_patches = set()
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolgrammarpy"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/Scripts/webkitpy/tool/grammar.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/grammar.py     2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/grammar.py        2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -1,57 +0,0 @@
</span><del>-# Copyright (c) 2009 Google Inc. All rights reserved.
-# Copyright (c) 2009 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import re
-
-
-def plural(noun):
-    # This is a dumb plural() implementation that is just enough for our uses.
-    if re.search("h$", noun):
-        return noun + "es"
-    else:
-        return noun + "s"
-
-
-def pluralize(count, noun, showCount=True):
-    if count != 1:
-        noun = plural(noun)
-    if showCount:
-        return "%d %s" % (count, noun)
-    else:
-        return "%s" % noun
-
-
-def join_with_separators(list_of_strings, separator=', ', only_two_separator=" and ", last_separator=', and '):
-    if not list_of_strings:
-        return ""
-    if len(list_of_strings) == 1:
-        return list_of_strings[0]
-    if len(list_of_strings) == 2:
-        return only_two_separator.join(list_of_strings)
-    return "%s%s%s" % (separator.join(list_of_strings[:-1]), last_separator, list_of_strings[-1])
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolgrammar_unittestpy"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/Scripts/webkitpy/tool/grammar_unittest.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/grammar_unittest.py    2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/grammar_unittest.py       2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest
-
-from webkitpy.tool.grammar import join_with_separators
-from webkitpy.tool.grammar import plural
-from webkitpy.tool.grammar import pluralize
-
-
-class GrammarTest(unittest.TestCase):
-
-    def test_join_with_separators(self):
-        self.assertEqual(join_with_separators(["one"]), "one")
-        self.assertEqual(join_with_separators(["one", "two"]), "one and two")
-        self.assertEqual(join_with_separators(["one", "two", "three"]), "one, two, and three")
-
-    def test_plural(self):
-        self.assertEqual(plural("patch"), "patches")
-        self.assertEqual(plural("test"), "tests")
-
-    def test_pluralize(self):
-        self.assertEqual(pluralize(1, "patch"), "1 patch")
-        self.assertEqual(pluralize(2, "patch"), "2 patches")
-        self.assertEqual(pluralize(1, "patch", True), "1 patch")
-        self.assertEqual(pluralize(2, "patch", True), "2 patches")
-        self.assertEqual(pluralize(1, "patch", False), "patch")
-        self.assertEqual(pluralize(2, "patch", False), "patches")
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolmulticommandtoolpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/multicommandtool.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/multicommandtool.py    2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/multicommandtool.py       2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> from optparse import OptionParser, IndentedHelpFormatter, SUPPRESS_USAGE, make_option
</span><span class="cx"> 
</span><del>-from webkitpy.tool.grammar import pluralize
</del><ins>+from webkitcorepy.string_utils import pluralize
</ins><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolstepsobsoletepatchespy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/steps/obsoletepatches.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/steps/obsoletepatches.py       2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/obsoletepatches.py  2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -28,7 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> import logging
</span><span class="cx"> 
</span><del>-from webkitpy.tool.grammar import pluralize
</del><ins>+from webkitcorepy.string_utils import pluralize
+
</ins><span class="cx"> from webkitpy.tool.steps.abstractstep import AbstractStep
</span><span class="cx"> from webkitpy.tool.steps.options import Options
</span><span class="cx"> 
</span><span class="lines">@@ -49,6 +50,6 @@
</span><span class="cx">         patches = self._tool.bugs.fetch_bug(bug_id).patches()
</span><span class="cx">         if not patches:
</span><span class="cx">             return
</span><del>-        _log.info("Obsoleting %s on bug %s" % (pluralize(len(patches), "old patch"), bug_id))
</del><ins>+        _log.info("Obsoleting %s on bug %s" % (pluralize(len(patches), 'old patch', plural='old patches'), bug_id))
</ins><span class="cx">         for patch in patches:
</span><span class="cx">             self._tool.bugs.obsolete_attachment(patch.id())
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolstepspreparechangelogforrevertpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py     2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py        2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -26,9 +26,10 @@
</span><span class="cx"> # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><ins>+from webkitcorepy import string_utils
+
</ins><span class="cx"> from webkitpy.common.checkout.changelog import ChangeLog
</span><span class="cx"> from webkitpy.common.config import urls
</span><del>-from webkitpy.tool import grammar
</del><span class="cx"> from webkitpy.tool.steps.abstractstep import AbstractStep
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -35,7 +36,7 @@
</span><span class="cx"> class PrepareChangeLogForRevert(AbstractStep):
</span><span class="cx">     @classmethod
</span><span class="cx">     def _message_for_revert(cls, revision_list, reason, description_list, reverted_bug_url_list, revert_bug_url=None):
</span><del>-        message = "Unreviewed, reverting %s.\n" % grammar.join_with_separators(['r' + str(revision) for revision in revision_list])
</del><ins>+        message = "Unreviewed, reverting %s.\n" % string_utils.join(['r' + str(revision) for revision in revision_list])
</ins><span class="cx">         if revert_bug_url:
</span><span class="cx">             message += "%s\n" % revert_bug_url
</span><span class="cx">         message += "\n"
</span><span class="lines">@@ -42,7 +43,7 @@
</span><span class="cx">         if reason:
</span><span class="cx">             message += "%s\n" % reason
</span><span class="cx">         message += "\n"
</span><del>-        message += "Reverted %s:\n\n" % grammar.pluralize(len(revision_list), "changeset", showCount=False)
</del><ins>+        message += "Reverted changeset%s:\n\n" % ('s' if len(revision_list) > 1 else '')
</ins><span class="cx">         for index in range(len(revision_list)):
</span><span class="cx">             if description_list[index]:
</span><span class="cx">                 message += "\"%s\"\n" % description_list[index]
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolstepspreparechangelogforrevert_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py    2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py       2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> 
</span><span class="cx">     _multiple_revert_entry = '''2009-08-19  Eric Seidel  <eric@webkit.org>
</span><span class="cx"> 
</span><del>-        Unreviewed, reverting r12345, r12346, and r12347.
</del><ins>+        Unreviewed, reverting r12345, r12346 and r12347.
</ins><span class="cx"> 
</span><span class="cx">         Reason
</span><span class="cx"> 
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> 
</span><span class="cx">     _multiple_revert_entry_with_missing_bug_urls_and_descriptions = '''2009-08-19  Eric Seidel  <eric@webkit.org>
</span><span class="cx"> 
</span><del>-        Unreviewed, reverting r12345, r12346, and r12347.
</del><ins>+        Unreviewed, reverting r12345, r12346 and r12347.
</ins><span class="cx"> 
</span><span class="cx">         Reason
</span><span class="cx"> 
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx"> 
</span><span class="cx">     _multiple_revert_entry_with_a_missing_bug_url_and_description = '''2009-08-19  Eric Seidel  <eric@webkit.org>
</span><span class="cx"> 
</span><del>-        Unreviewed, reverting r12345, r12346, and r12347.
</del><ins>+        Unreviewed, reverting r12345, r12346 and r12347.
</ins><span class="cx"> 
</span><span class="cx">         Reason
</span><span class="cx"> 
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> 
</span><span class="cx">     _multiple_revert_entry_with_revert_bug_url = '''2009-08-19  Eric Seidel  <eric@webkit.org>
</span><span class="cx"> 
</span><del>-        Unreviewed, reverting r12345, r12346, and r12347.
</del><ins>+        Unreviewed, reverting r12345, r12346 and r12347.
</ins><span class="cx">         http://revert.example.com/56789
</span><span class="cx"> 
</span><span class="cx">         Reason
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolstepsreopenbugafterrevertpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/steps/reopenbugafterrevert.py (277734 => 277735)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/steps/reopenbugafterrevert.py  2021-05-19 18:09:30 UTC (rev 277734)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/reopenbugafterrevert.py     2021-05-19 18:09:45 UTC (rev 277735)
</span><span class="lines">@@ -28,8 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> import logging
</span><span class="cx"> 
</span><ins>+from webkitcorepy import string_utils
+
</ins><span class="cx"> from webkitpy.tool.comments import bug_comment_from_commit_text
</span><del>-from webkitpy.tool.grammar import join_with_separators
</del><span class="cx"> from webkitpy.tool.steps.abstractstep import AbstractStep
</span><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="lines">@@ -38,7 +39,7 @@
</span><span class="cx"> class ReopenBugAfterRevert(AbstractStep):
</span><span class="cx">     def run(self, state):
</span><span class="cx">         commit_comment = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
</span><del>-        revision_list = join_with_separators(['r' + str(revision) for revision in state["revision_list"]])
</del><ins>+        revision_list = string_utils.join(['r' + str(revision) for revision in state["revision_list"]])
</ins><span class="cx">         comment_text = "Reverted %s for reason:\n\n%s\n\n%s" % (revision_list, state["reason"], commit_comment)
</span><span class="cx">         bug_ids = state["bug_id_list"]
</span><span class="cx">         if not bug_ids:
</span></span></pre>
</div>
</div>

</body>
</html>