[snowpatch] [PATCH] Allow use of the --project flag in polling mode, not just with --mbox
Andrew Donnellan
andrew.donnellan at au1.ibm.com
Tue Jul 19 14:46:49 AEST 2016
A user may want to run snowpatch in normal patchwork polling mode, but only
test one particular project. Expand the --project flag so it can be used
for this case.
Closes: #22 ("Allow use of --project switch in normal mode, not just with
--mbox")
Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
---
src/main.rs | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 57fd5ad..b203b10 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -64,8 +64,8 @@ mod utils;
static USAGE: &'static str = "
Usage:
- snowpatch <config-file> [--count=<count> | --series <id>]
- snowpatch <config-file> --mbox=<mbox> --project=<name>
+ snowpatch <config-file> [--count=<count> | --series <id>] [--project <name>]
+ snowpatch <config-file> --mbox <mbox> --project <name>
snowpatch -v | --version
snowpatch -h | --help
@@ -74,8 +74,8 @@ By default, snowpatch runs as a long-running daemon.
Options:
--count <count> Run tests on <count> recent series.
--series <id> Run tests on the given Patchwork series.
- --mbox <mbox> Run tests on the given mbox file...
- --project <name> ...as if it were sent to project <name>.
+ --mbox <mbox> Run tests on the given mbox file. Requires --project
+ --project <name> Test patches for the given project.
-v, --version Output version information.
-h, --help Output this help text.
";
@@ -325,6 +325,12 @@ fn main() {
continue;
}
+ // Skip if we're using -p and it's the wrong project
+ if args.flag_project != "" && series.project.linkname != args.flag_project {
+ debug!("Skipping series {} (wrong project: {})", series.project.linkname);
+ continue;
+ }
+
match settings.projects.get(&series.project.linkname) {
None => {
debug!("Project {} not configured for series {} ({})",
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com IBM Australia Limited
More information about the snowpatch
mailing list