Replace non-inclusive terms

Bug: 1118410, 1118413, 1118422, 1118424, 1118426
Bug: 1118428, 1118430, 1118434, 1118438, 1118442
Bug: 1118453, 1118454
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: build
Change-Id: I43e6305f8c3136774f01b57f12bb442bcb863371
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2551388
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
diff --git a/README.git-cl.md b/README.git-cl.md
index f37c056..8d95be3 100644
--- a/README.git-cl.md
+++ b/README.git-cl.md
@@ -45,7 +45,7 @@
    (Note that this association is tied to a branch, not a commit, which means
    you need a separate branch per review.)
 3. If your branch is _tracking_ (in the `git checkout --track` sense) another
-   one (like origin/master), calls to `git cl upload` will diff against that
+   one (like origin/main), calls to `git cl upload` will diff against that
    branch by default.  (You can still pass arguments to `git diff` on the
    command line, if necessary.)
 
diff --git a/bootstrap/README.md b/bootstrap/README.md
index c19c57e..7c24fc6 100644
--- a/bootstrap/README.md
+++ b/bootstrap/README.md
@@ -47,7 +47,7 @@
 ### Bundles
 
 Git and Python bundle construction is documented in
-[infra packaging](https://chromium.googlesource.com/infra/infra/+/master/doc/packaging/).
+[infra packaging](https://chromium.googlesource.com/infra/infra/+/HEAD/doc/packaging/).
 
 Note that in order for the update to take effect, `gclient` currently needs to
 run twice. The first time it will update the `depot_tools` repo, and the second
diff --git a/gclient.py b/gclient.py
index ba75b78..471f431 100755
--- a/gclient.py
+++ b/gclient.py
@@ -404,7 +404,7 @@
     self._file_list = []
     # List of host names from which dependencies are allowed.
     # Default is an empty set, meaning unspecified in DEPS file, and hence all
-    # hosts will be allowed. Non-empty set means whitelist of hosts.
+    # hosts will be allowed. Non-empty set means allowlist of hosts.
     # allowed_hosts var is scoped to its DEPS file, and so it isn't recursive.
     self._allowed_hosts = frozenset()
     self._gn_args_from = None
diff --git a/gclient_scm.py b/gclient_scm.py
index 76a32b9..af4665d 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -345,7 +345,7 @@
 
     The patch ref is given by |patch_repo|@|patch_rev|.
     |target_rev| is usually the branch that the |patch_rev| was uploaded against
-    (e.g. 'refs/heads/master'), but this is not required.
+    (e.g. 'refs/heads/main'), but this is not required.
 
     We cherry-pick all commits reachable from |patch_rev| on top of the curret
     HEAD, excluding those reachable from |target_rev|
@@ -371,7 +371,7 @@
           e.g. 'refs/changes/1234/34/1'.
       target_rev: The revision to use when finding the merge base.
           Typically, the branch that the patch was uploaded against.
-          e.g. 'refs/heads/master' or 'refs/heads/infra/config'.
+          e.g. 'refs/heads/main' or 'refs/heads/infra/config'.
       options: The options passed to gclient.
       file_list: A list where modified files will be appended.
     """
@@ -632,9 +632,9 @@
     #      - checkout new branch
     #   c) otherwise exit
 
-    # GetUpstreamBranch returns something like 'refs/remotes/origin/master' for
+    # GetUpstreamBranch returns something like 'refs/remotes/origin/main' for
     # a tracking branch
-    # or 'master' if not a tracking branch (it's based on a specific rev/hash)
+    # or 'main' if not a tracking branch (it's based on a specific rev/hash)
     # or it returns None if it couldn't find an upstream
     if cur_branch is None:
       upstream_branch = None
diff --git a/git_common.py b/git_common.py
index e9b3220..2bc1b5c 100644
--- a/git_common.py
+++ b/git_common.py
@@ -75,7 +75,7 @@
 
 
 # NOTE: This list is DEPRECATED in favor of the Infra Git wrapper:
-# https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/tools/git
+# https://chromium.googlesource.com/infra/infra/+/HEAD/go/src/infra/tools/git
 #
 # New entries should be added to the Git wrapper, NOT to this list. "git_retry"
 # is, similarly, being deprecated in favor of the Git wrapper.
@@ -629,7 +629,7 @@
 
   A commitref is anything which can resolve to a commit. Popular examples:
     * 'HEAD'
-    * 'origin/master'
+    * 'origin/main'
     * 'cool_branch~2'
   """
   try:
diff --git a/git_footers.py b/git_footers.py
index a25e562..766a958 100755
--- a/git_footers.py
+++ b/git_footers.py
@@ -192,9 +192,9 @@
   Returns:
     A tuple of the branch and the position on that branch. For example,
 
-    Cr-Commit-Position: refs/heads/master@{#292272}
+    Cr-Commit-Position: refs/heads/main@{#292272}
 
-    would give the return value ('refs/heads/master', 292272).
+    would give the return value ('refs/heads/main', 292272).
   """
 
   position = get_unique(footers, 'Cr-Commit-Position')
diff --git a/git_map_branches.py b/git_map_branches.py
index c35368f..8c5ea71 100755
--- a/git_map_branches.py
+++ b/git_map_branches.py
@@ -6,7 +6,7 @@
 """Print dependency tree of branches in local repo.
 
 Example:
-origin/master
+origin/main
   cool_feature
     dependent_feature
     other_dependent_feature
diff --git a/git_new_branch.py b/git_new_branch.py
index f2ca024..3a07c27 100755
--- a/git_new_branch.py
+++ b/git_new_branch.py
@@ -3,7 +3,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 """
-Create new branch tracking origin/master by default.
+Create new branch tracking origin HEAD by default.
 """
 
 import argparse
diff --git a/git_retry.py b/git_retry.py
index bc3ce08..0dc90ee 100755
--- a/git_retry.py
+++ b/git_retry.py
@@ -7,7 +7,7 @@
 """Generic retry wrapper for Git operations. 
 
 This is largely DEPRECATED in favor of the Infra Git wrapper:
-https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/tools/git
+https://chromium.googlesource.com/infra/infra/+/HEAD/go/src/infra/tools/git
 """
 
 import logging
@@ -120,7 +120,7 @@
 
 def main(args):
   # If we're using the Infra Git wrapper, do nothing here.
-  # https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/tools/git
+  # https://chromium.googlesource.com/infra/infra/+/HEAD/go/src/infra/tools/git
   if 'INFRA_GIT_WRAPPER' in os.environ:
     # Remove Git's execution path from PATH so that our call-through re-invokes
     # the Git wrapper.
diff --git a/gsutil.vpython b/gsutil.vpython
index 8a2a38a..b0a6462 100644
--- a/gsutil.vpython
+++ b/gsutil.vpython
@@ -1,7 +1,7 @@
 # vpython VirtualEnv protobuf for "gsutil".
 #
 # See:
-# https://chromium.googlesource.com/infra/luci/luci-go/+/master/vpython/api/vpython/spec.proto
+# https://chromium.googlesource.com/infra/luci/luci-go/+/HEAD/vpython/api/vpython/spec.proto
 #
 # This is a "vpython" VirtualEnv specification applied to invocations of "gsutil"
 # by the bootstrap wrapper, "gsutil.py". It ensures that any Python distribution
diff --git a/metrics.README.md b/metrics.README.md
index f763353..5a0adb1 100644
--- a/metrics.README.md
+++ b/metrics.README.md
@@ -30,7 +30,7 @@
 - We won't record information about the current directory or environment flags.
 - We won't record arbitrary strings. We only collect a string if it is in the
   list available at
-  https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/appengine/depot_tools_metrics/metrics/constants.go
+  https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/appengine/depot_tools_metrics/metrics/constants.go
 
 The metrics we're collecting are:
 
@@ -72,10 +72,10 @@
   - What was the exit code?
 
 The list of all known strings we collect can be found at
-https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/appengine/depot_tools_metrics/metrics/constants.go
+https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/appengine/depot_tools_metrics/metrics/constants.go
 
 The schema for the metrics being collected can be found at
-https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/appengine/depot_tools_metrics/schema/schema.proto
+https://source.chromium.org/chromium/infra/infra/+/HEAD:go/src/infra/appengine/depot_tools_metrics/schema/schema.proto
 
 ## Why am I seeing this message *again*?
 
diff --git a/recipes/recipe_modules/gerrit/examples/full.expected/basic.json b/recipes/recipe_modules/gerrit/examples/full.expected/basic.json
index 1352423..910ba3c 100644
--- a/recipes/recipe_modules/gerrit/examples/full.expected/basic.json
+++ b/recipes/recipe_modules/gerrit/examples/full.expected/basic.json
@@ -52,7 +52,7 @@
     "name": "gerrit get_gerrit_branch (v8/v8 master)",
     "~followup_annotations": [
       "@@@STEP_LOG_LINE@json.output@{@@@",
-      "@@@STEP_LOG_LINE@json.output@  \"ref\": \"refs/heads/master\", @@@",
+      "@@@STEP_LOG_LINE@json.output@  \"ref\": \"refs/heads/main\", @@@",
       "@@@STEP_LOG_LINE@json.output@  \"revision\": \"67ebf73496383c6777035e374d2d664009e2aa5c\"@@@",
       "@@@STEP_LOG_LINE@json.output@}@@@",
       "@@@STEP_LOG_END@json.output@@@"
@@ -136,7 +136,7 @@
       "@@@STEP_LOG_LINE@json.output@[@@@",
       "@@@STEP_LOG_LINE@json.output@  {@@@",
       "@@@STEP_LOG_LINE@json.output@    \"_number\": \"91827\", @@@",
-      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"master\", @@@",
+      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"main\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"change_id\": \"Ideadbeef\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"created\": \"2017-01-30 13:11:20.000000000\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"has_review_started\": false, @@@",
@@ -211,7 +211,7 @@
       "@@@STEP_LOG_LINE@json.output@[@@@",
       "@@@STEP_LOG_LINE@json.output@  {@@@",
       "@@@STEP_LOG_LINE@json.output@    \"_number\": \"91827\", @@@",
-      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"master\", @@@",
+      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"main\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"change_id\": \"Ideadbeef\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"created\": \"2017-01-30 13:11:20.000000000\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"has_review_started\": false, @@@",
@@ -255,7 +255,7 @@
       "@@@STEP_LOG_LINE@json.output@[@@@",
       "@@@STEP_LOG_LINE@json.output@  {@@@",
       "@@@STEP_LOG_LINE@json.output@    \"_number\": \"123\", @@@",
-      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"master\", @@@",
+      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"main\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"change_id\": \"Ideadbeef\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"created\": \"2017-01-30 13:11:20.000000000\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"has_review_started\": false, @@@",
@@ -303,7 +303,7 @@
       "@@@STEP_LOG_LINE@json.output@[@@@",
       "@@@STEP_LOG_LINE@json.output@  {@@@",
       "@@@STEP_LOG_LINE@json.output@    \"_number\": \"91827\", @@@",
-      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"master\", @@@",
+      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"main\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"change_id\": \"Ideadbeef\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"created\": \"2017-01-30 13:11:20.000000000\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"has_review_started\": false, @@@",
diff --git a/recipes/recipe_modules/gerrit/test_api.py b/recipes/recipe_modules/gerrit/test_api.py
index 6844daf..1896c2e 100644
--- a/recipes/recipe_modules/gerrit/test_api.py
+++ b/recipes/recipe_modules/gerrit/test_api.py
@@ -14,7 +14,7 @@
   'change_id': 'Ideadbeef',
   'project': 'chromium/src',
   'has_review_started': False,
-  'branch': 'master',
+  'branch': 'main',
   'subject': 'Change title',
   'revisions': {
     '184ebe53805e102605d11f6b143486d15c23a09c': {
@@ -40,7 +40,7 @@
 
   def make_gerrit_get_branch_response_data(self):
     return self._make_gerrit_response_json({
-      "ref": "refs/heads/master",
+      "ref": "refs/heads/main",
       "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
     })
 
diff --git a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json
index 7a43ce9..1842a15 100644
--- a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json
+++ b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json
@@ -70,7 +70,7 @@
       "@@@STEP_LOG_LINE@json.output@[@@@",
       "@@@STEP_LOG_LINE@json.output@  {@@@",
       "@@@STEP_LOG_LINE@json.output@    \"_number\": \"91827\", @@@",
-      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"master\", @@@",
+      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"main\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"change_id\": \"Ideadbeef\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"created\": \"2017-01-30 13:11:20.000000000\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"has_review_started\": false, @@@",
diff --git a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json
index d7507bb..99cf747 100644
--- a/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json
+++ b/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json
@@ -70,7 +70,7 @@
       "@@@STEP_LOG_LINE@json.output@[@@@",
       "@@@STEP_LOG_LINE@json.output@  {@@@",
       "@@@STEP_LOG_LINE@json.output@    \"_number\": \"91827\", @@@",
-      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"master\", @@@",
+      "@@@STEP_LOG_LINE@json.output@    \"branch\": \"main\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"change_id\": \"Ideadbeef\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"created\": \"2017-01-30 13:11:20.000000000\", @@@",
       "@@@STEP_LOG_LINE@json.output@    \"has_review_started\": false, @@@",
diff --git a/recipes/recipes.py b/recipes/recipes.py
index 9b13aa5..a49b3ee 100755
--- a/recipes/recipes.py
+++ b/recipes/recipes.py
@@ -19,7 +19,7 @@
 ** DO NOT MODIFY **
 *******************
 
-This is a copy of https://chromium.googlesource.com/infra/luci/recipes-py/+/master/recipes.py.
+This is a copy of https://chromium.googlesource.com/infra/luci/recipes-py/+/HEAD/recipes.py.
 To fix bugs, fix in the googlesource repo then run the autoroller.
 """
 
@@ -40,7 +40,7 @@
 # url (str) - the url to the engine repo we want to use.
 # revision (str) - the git revision for the engine to get.
 # branch (str) - the branch to fetch for the engine as an absolute ref (e.g.
-#   refs/heads/master)
+#   refs/heads/main)
 EngineDep = namedtuple('EngineDep', 'url revision branch')
 
 
diff --git a/roll_dep.py b/roll_dep.py
index 64ef15e..f5f8a60 100755
--- a/roll_dep.py
+++ b/roll_dep.py
@@ -6,7 +6,7 @@
 """Rolls DEPS controlled dependency.
 
 Works only with git checkout and git dependencies.  Currently this
-script will always roll to the tip of to origin/master.
+script will always roll to the tip of to origin/main or origin/master.
 """
 
 from __future__ import print_function
@@ -32,11 +32,11 @@
     # Subject
     r'('
       # Generated by
-      # https://skia.googlesource.com/buildbot/+/master/autoroll/go/repo_manager/deps_repo_manager.go
+      # https://skia.googlesource.com/buildbot/+/HEAdA/autoroll/go/repo_manager/deps_repo_manager.go
       r'Roll [^ ]+ [a-f0-9]+\.\.[a-f0-9]+ \(\d+ commits\)'
       r'|'
       # Generated by
-      # https://chromium.googlesource.com/infra/infra/+/master/recipes/recipe_modules/recipe_autoroller/api.py
+      # https://chromium.googlesource.com/infra/infra/+/HEAD/recipes/recipe_modules/recipe_autoroller/api.py
       r'Roll recipe dependencies \(trivial\)\.'
     r')$')
 
@@ -89,16 +89,16 @@
 
   raise Error('Couldn\'t find any of origin/main or origin/master')
 
-def get_log_url(upstream_url, head, master):
+def get_log_url(upstream_url, head, tot):
   """Returns an URL to read logs via a Web UI if applicable."""
   if re.match(r'https://[^/]*\.googlesource\.com/', upstream_url):
     # gitiles
-    return '%s/+log/%s..%s' % (upstream_url, head[:12], master[:12])
+    return '%s/+log/%s..%s' % (upstream_url, head[:12], tot[:12])
   if upstream_url.startswith('https://github.com/'):
     upstream_url = upstream_url.rstrip('/')
     if upstream_url.endswith('.git'):
       upstream_url = upstream_url[:-len('.git')]
-    return '%s/compare/%s...%s' % (upstream_url, head[:12], master[:12])
+    return '%s/compare/%s...%s' % (upstream_url, head[:12], tot[:12])
   return None
 
 
diff --git a/scm.py b/scm.py
index c374a66..4e1bdde 100644
--- a/scm.py
+++ b/scm.py
@@ -187,7 +187,7 @@
 
   @staticmethod
   def GetBranchRef(cwd):
-    """Returns the full branch reference, e.g. 'refs/heads/master'."""
+    """Returns the full branch reference, e.g. 'refs/heads/main'."""
     try:
       return GIT.Capture(['symbolic-ref', 'HEAD'], cwd=cwd)
     except subprocess2.CalledProcessError:
@@ -195,7 +195,7 @@
 
   @staticmethod
   def GetBranch(cwd):
-    """Returns the short branch name, e.g. 'master'."""
+    """Returns the short branch name, e.g. 'main'."""
     branchref = GIT.GetBranchRef(cwd)
     if branchref:
       return GIT.ShortBranchName(branchref)
@@ -208,7 +208,7 @@
   @staticmethod
   def FetchUpstreamTuple(cwd, branch=None):
     """Returns a tuple containing remote and remote ref,
-       e.g. 'origin', 'refs/heads/master'
+       e.g. 'origin', 'refs/heads/main'
     """
     try:
       branch = branch or GIT.GetBranch(cwd)
diff --git a/tests/bot_update_coverage_test.py b/tests/bot_update_coverage_test.py
index a3dbba6..4a971a4 100755
--- a/tests/bot_update_coverage_test.py
+++ b/tests/bot_update_coverage_test.py
@@ -174,7 +174,7 @@
     setattr(bot_update, 'git', fake_git)
 
     self.old_os_cwd = os.getcwd
-    setattr(os, 'getcwd', lambda: '/b/build/slave/foo/build')
+    setattr(os, 'getcwd', lambda: '/b/build/foo/build')
 
     setattr(bot_update, 'open', self.filesystem.open)
     self.old_codecs_open = codecs.open
@@ -272,7 +272,7 @@
 
   def testGitCheckoutBreaksLocks(self):
     self.overrideSetupForWindows()
-    path = '/b/build/slave/foo/build/.git'
+    path = '/b/build/foo/build/.git'
     lockfile = 'index.lock'
     removed = []
     old_os_walk = os.walk
diff --git a/weekly b/weekly
index aa93d90..6f9bd1d 100755
--- a/weekly
+++ b/weekly
@@ -21,7 +21,7 @@
 
   author_option = ' '.join(['--author=' + author for author in authors])
   command = ' '.join(['git log', author_option, '--since="%s"' % since,
-                      'origin/master', '| git shortlog'])
+                      'origin/HEAD', '| git shortlog'])
   status = subprocess.Popen(['sh', '-c', command],
                             cwd=path,
                             stdout=subprocess.PIPE).communicate()[0].rstrip()
diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py
index a595605..24270c8 100755
--- a/win_toolchain/get_toolchain_if_necessary.py
+++ b/win_toolchain/get_toolchain_if_necessary.py
@@ -526,11 +526,11 @@
         RequestGsAuthentication()
     if not should_use_file and not should_use_gs and not should_use_http:
       if sys.platform not in ('win32', 'cygwin'):
-        doc = 'https://chromium.googlesource.com/chromium/src/+/master/docs/' \
+        doc = 'https://chromium.googlesource.com/chromium/src/+/HEAD/docs/' \
               'win_cross.md'
         print('\n\n\nPlease follow the instructions at %s\n\n' % doc)
       else:
-        doc = 'https://chromium.googlesource.com/chromium/src/+/master/docs/' \
+        doc = 'https://chromium.googlesource.com/chromium/src/+/HEAD/docs/' \
               'windows_build_instructions.md'
         print('\n\n\nNo downloadable toolchain found. In order to use your '
               'locally installed version of Visual Studio to build Chrome '