Consider whether the builder is internal or external for manifest changes.

When applying manifest changes, apply internal or external changes only when
on doing a matching type of build. This prevents changes for one (or both)
type of manifest from being incorrectly applied to the other.

BUG=chromium:372508
TEST=Ran run_tests. Ran a tryjob with test CLs which modify the "notice" text
in both the internal and external manifests with and without this change.
Without this change I was able to reproduce the failure in bug 372508. With
this change the failure went away. Special effort had to be made so that
chromite was restarted after its changes were applied and before the manifest
changes were applied.

Change-Id: I28e9143ec204d641f01200eb17dcb0084c3707dc
Reviewed-on: https://chromium-review.googlesource.com/200248
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 22f086e..8aa76d0 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -331,7 +331,10 @@
     """
     stage = None
     chromite_pool = self.patch_pool.Filter(project=constants.CHROMITE_PROJECT)
-    manifest_pool = self.patch_pool.FilterManifest()
+    if self._run.config.internal:
+      manifest_pool = self.patch_pool.FilterIntManifest()
+    else:
+      manifest_pool = self.patch_pool.FilterExtManifest()
     chromite_branch = git.GetChromiteTrackingBranch()
     if (chromite_pool or manifest_pool or
         self._run.options.test_bootstrap or