PatchChangesStage: Filter out manifest patches.

Manifest patches will be done during the bootstrap stage, so filter them
out in PatchChangesStage to prevent errors
(i.e., 'project chromiumos/manifest project not found').

BUG=chromium-os:23277
TEST=remote trybots

Change-Id: I2408dd036610bf9647ffbdd103fee06ce9c9c0f5
Reviewed-on: https://gerrit.chromium.org/gerrit/30741
Commit-Ready: Ryan Cui <rcui@chromium.org>
Reviewed-by: Ryan Cui <rcui@chromium.org>
Tested-by: Ryan Cui <rcui@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 812681e..83c6325 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -321,8 +321,11 @@
       sync_instance.Run()
       self._SetReleaseTag()
 
-      if self.patch_pool:
-        self._RunStage(stages.PatchChangesStage, self.patch_pool)
+      # Filter out patches to manifest, since PatchChangesStage can't handle
+      # them.  Manifest patches are patched in the BootstrapStage.
+      non_manifest_patches = self.patch_pool.FilterManifest(negate=True)
+      if non_manifest_patches:
+        self._RunStage(stages.PatchChangesStage, non_manifest_patches)
 
       if self._ShouldReExecuteInBuildRoot():
         print_report = False