From e6f3aad84e91c76568b766f9142fdae52f0f3242 Mon Sep 17 00:00:00 2001
From: Zach Hilman <zachhilman@gmail.com>
Date: Mon, 30 Sep 2019 09:29:28 -0400
Subject: [PATCH 1/2] ci: Populate patreon PRs on public repository

---
 .../merge/apply-patches-by-label-private.py       |  2 +-
 .ci/scripts/merge/apply-patches-by-label.py       |  2 +-
 .ci/templates/mergebot-private.yml                | 15 +++++++++++----
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/.ci/scripts/merge/apply-patches-by-label-private.py b/.ci/scripts/merge/apply-patches-by-label-private.py
index 11ec600100..6e3cb995e7 100644
--- a/.ci/scripts/merge/apply-patches-by-label-private.py
+++ b/.ci/scripts/merge/apply-patches-by-label-private.py
@@ -5,7 +5,7 @@ import requests, sys, json, urllib3.request, shutil, subprocess, os, traceback
 
 org = os.getenv("PrivateMergeOrg".upper(), "yuzu-emu")
 repo = os.getenv("PrivateMergeRepo".upper(), "yuzu-private")
-tagline = os.getenv("MergeTaglinePrivate".upper(), "")
+tagline = sys.argv[3]
 user = sys.argv[1]
 
 http = urllib3.PoolManager()
diff --git a/.ci/scripts/merge/apply-patches-by-label.py b/.ci/scripts/merge/apply-patches-by-label.py
index 7f1ea06cf8..e81db92871 100644
--- a/.ci/scripts/merge/apply-patches-by-label.py
+++ b/.ci/scripts/merge/apply-patches-by-label.py
@@ -3,7 +3,7 @@
 
 import requests, sys, json, urllib3.request, shutil, subprocess, os
 
-tagline = os.getenv("MergeTaglinePublic".upper(), "")
+tagline = sys.argv[2]
 
 http = urllib3.PoolManager()
 dl_list = {}
diff --git a/.ci/templates/mergebot-private.yml b/.ci/templates/mergebot-private.yml
index a673c5b01b..0ba6d54348 100644
--- a/.ci/templates/mergebot-private.yml
+++ b/.ci/templates/mergebot-private.yml
@@ -8,16 +8,23 @@ steps:
   - script: chmod a+x $(System.DefaultWorkingDirectory)/.ci/scripts/merge/yuzubot-git-config.sh && $(System.DefaultWorkingDirectory)/.ci/scripts/merge/yuzubot-git-config.sh
     displayName: 'Apply Git Configuration'
   - task: PythonScript@0
-    displayName: 'Discover, Download, and Apply Patches'
+    displayName: 'Discover, Download, and Apply Patches (Mainline)'
     inputs:
       scriptSource: 'filePath'
       scriptPath: '.ci/scripts/merge/apply-patches-by-label.py'
-      arguments: '${{ parameters.matchLabelPublic }} patches-public'
+      arguments: '${{ parameters.matchLabelPublic }} $(MergeTaglinePublic) patches-public'
       workingDirectory: '$(System.DefaultWorkingDirectory)'
   - task: PythonScript@0
-    displayName: 'Discover, Download, and Apply Patches'
+    displayName: 'Discover, Download, and Apply Patches (Patreon Public)'
+    inputs:
+      scriptSource: 'filePath'
+      scriptPath: '.ci/scripts/merge/apply-patches-by-label.py'
+      arguments: '${{ parameters.matchLabel }} $(MergeTaglinePrivate)\ Public patches-mixed-public'
+      workingDirectory: '$(System.DefaultWorkingDirectory)'
+  - task: PythonScript@0
+    displayName: 'Discover, Download, and Apply Patches (Patreon Private)'
     inputs:
       scriptSource: 'filePath'
       scriptPath: '.ci/scripts/merge/apply-patches-by-label-private.py'
-      arguments: '$(PrivateMergeUser) ${{ parameters.matchLabel }} patches-private'
+      arguments: '$(PrivateMergeUser) ${{ parameters.matchLabel }} $(MergeTaglinePrivate)\ Private patches-private'
       workingDirectory: '$(System.DefaultWorkingDirectory)'

From 4ea425d6cf8b77a989203a8d9771b78da7c48c96 Mon Sep 17 00:00:00 2001
From: Zach Hilman <zachhilman@gmail.com>
Date: Mon, 30 Sep 2019 13:43:34 -0400
Subject: [PATCH 2/2] ci: Correct arguments for mergebot script

---
 .ci/templates/mergebot-private.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.ci/templates/mergebot-private.yml b/.ci/templates/mergebot-private.yml
index 0ba6d54348..f9a40cf61f 100644
--- a/.ci/templates/mergebot-private.yml
+++ b/.ci/templates/mergebot-private.yml
@@ -19,12 +19,12 @@ steps:
     inputs:
       scriptSource: 'filePath'
       scriptPath: '.ci/scripts/merge/apply-patches-by-label.py'
-      arguments: '${{ parameters.matchLabel }} $(MergeTaglinePrivate)\ Public patches-mixed-public'
+      arguments: '${{ parameters.matchLabel }} "$(MergeTaglinePrivate) Public" patches-mixed-public'
       workingDirectory: '$(System.DefaultWorkingDirectory)'
   - task: PythonScript@0
     displayName: 'Discover, Download, and Apply Patches (Patreon Private)'
     inputs:
       scriptSource: 'filePath'
       scriptPath: '.ci/scripts/merge/apply-patches-by-label-private.py'
-      arguments: '$(PrivateMergeUser) ${{ parameters.matchLabel }} $(MergeTaglinePrivate)\ Private patches-private'
+      arguments: '$(PrivateMergeUser) ${{ parameters.matchLabel }} "$(MergeTaglinePrivate) Private" patches-private'
       workingDirectory: '$(System.DefaultWorkingDirectory)'