config: enable loading of project wide defaults

Look for GLOBAL-PREUPLOAD.cfg files in the root of the repo checkout and
in the manifests git repo.  This way people can set up defaults that cover
all of the projects under this one manifest if they want.

Bug: 29606287
Test: put some config files in the common locations and saw their settings merged
Change-Id: I3fcecdf023cc49e89b952c46df2a52470d0c309a
diff --git a/pre-upload.py b/pre-upload.py
index 6cb19b7..81720a5 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -98,8 +98,19 @@
 
     Expects to be called from within the project root.
     """
+    global_paths = (
+        # Load the global config found in the manifest repo.
+        os.path.join(rh.git.find_repo_root(), '.repo', 'manifests'),
+        # Load the global config found in the root of the repo checkout.
+        rh.git.find_repo_root(),
+    )
+    paths = (
+        # Load the config for this git repo.
+        '.',
+    )
     try:
-        config = rh.config.PreSubmitConfig()
+        config = rh.config.PreSubmitConfig(paths=paths,
+                                           global_paths=global_paths)
     except rh.config.ValidationError as e:
         print('invalid config file: %s' % (e,), file=sys.stderr)
         sys.exit(1)