cbuildbot: Deprecate --config_repo.

Add an assert if --config_repo is used. We believe there are no users
left, this is to prove that is true with a small (easily reverted) CL.

After this assert soaks for a while, we will finish the removal of a
unneeded code in bigger followup CLs.

BUG=chromium:735696
TEST=Unittests

Change-Id: I580fc835fe4976c4d7cca094249752f435b2a1c2
Reviewed-on: https://chromium-review.googlesource.com/544116
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Ningning Xia <nxia@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index eaed29c..feff7be 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -428,8 +428,7 @@
   parser.add_remote_option('--profile',
                            help='Name of profile to sub-specify board variant.')
   parser.add_option('-c', '--config_repo',
-                    help='Cloneable path to the git repository containing '
-                         'the site configuration to use.')
+                    help='Deprecated option. Do not use!')
   # TODO(crbug.com/279618): Running GOMA is under development. Following
   # flags are added for development purpose due to repository dependency,
   # but not officially supported yet.
@@ -1077,32 +1076,6 @@
   return context
 
 
-def _FetchInitialBootstrapConfigRepo(repo_url, branch_name):
-  """Fetch the TOT site config repo, if necessary to start bootstrap."""
-
-  # If we are part of a repo checkout, the manifest stages control things.
-  if git.FindRepoDir(constants.SOURCE_ROOT):
-    return
-
-  # We must be part of a bootstrap chromite checkout, probably on a buildbot.
-
-  # If the config directory already exists, we have started the bootstrap
-  # process. Assume the boostrap stage did the right thing, and leave the config
-  # directory alone.
-  if os.path.exists(constants.SITE_CONFIG_DIR):
-    return
-
-  # We are part of a clean chromite checkout (buildbot always cleans chromite
-  # before launching us), so create the initial site config checkout.
-  logging.info('Fetching Config Repo: %s', repo_url)
-  git.Clone(constants.SITE_CONFIG_DIR, repo_url)
-
-  if branch_name:
-    git.RunGit(constants.SITE_CONFIG_DIR, ['checkout', branch_name])
-
-  # Clear the cached SiteConfig, if there was one.
-  config_lib.ClearConfigCache()
-
 # TODO(build): This function is too damn long.
 def main(argv):
   # Turn on strict sudo checks.
@@ -1114,13 +1087,8 @@
   parser = _CreateParser()
   options, args = ParseCommandLine(parser, argv)
 
-  if options.buildbot and options.config_repo:
-    _FetchInitialBootstrapConfigRepo(options.config_repo, options.branch)
-
   if options.config_repo:
-    # Ensure expected config file is present.
-    if not os.path.exists(constants.SITE_CONFIG_FILE):
-      cros_build_lib.Die('Unabled to find: %s', constants.SITE_CONFIG_FILE)
+    cros_build_lib.Die('Deprecated usage. Ping crbug.com/735696 you need it.')
 
   # Fetch our site_config now, because we need it to do anything else.
   site_config = config_lib.GetConfig()