patman: Split up check_and_show_status()
This function has three phases:
- collecting things from patchwork
- doing some processing
- showing the results to the user / creating a branch
Refactor into two functions so we can eventually have the patchwork part
fully separated out.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py
index 31ba708..ea96c50 100644
--- a/tools/patman/func_test.py
+++ b/tools/patman/func_test.py
@@ -790,7 +790,8 @@
series = Series()
with terminal.capture() as (_, err):
- status.collect_patches(series, 1234, None, self._fake_patchwork)
+ patches = status.collect_patches(1234, None, self._fake_patchwork)
+ status.check_patch_count(0, len(patches))
self.assertIn('Warning: Patchwork reports 1 patches, series has 0',
err.getvalue())
@@ -799,7 +800,7 @@
series = Series()
series.commits = [Commit('abcd')]
- patches = status.collect_patches(series, 1234, None,
+ patches = status.collect_patches(1234, None,
self._fake_patchwork)
self.assertEqual(1, len(patches))
patch = patches[0]