diff --git a/build/tools/repopick.py b/build/tools/repopick.py index 8d2d8355..43cc2845 100755 --- a/build/tools/repopick.py +++ b/build/tools/repopick.py @@ -281,6 +281,9 @@ def main(): parser.add_argument( "-t", "--topic", metavar="", help="pick all commits from a specified topic" ) + parser.add_argument( + "-H", "--hashtag", metavar="", help="pick all commits from a specified hashtag" + ) parser.add_argument( "-Q", "--query", metavar="", help="pick all commits using the specified query" ) @@ -327,9 +330,9 @@ def main(): if args.quiet and args.verbose: parser.error("--quiet and --verbose cannot be specified together") - if (1 << bool(args.change_number) << bool(args.topic) << bool(args.query)) != 2: + if (1 << bool(args.change_number) << bool(args.topic) << bool(args.hashtag) << bool(args.query)) != 2: parser.error( - "One (and only one) of change_number, topic, and query are allowed" + "One (and only one) of change_number, topic, hashtag and query are allowed" ) # Change current directory to the top of the tree @@ -423,6 +426,11 @@ def main(): change_numbers = [ str(r["number"]) for r in sorted(reviews, key=cmp_to_key(cmp_reviews)) ] + elif args.hashtag: + reviews = fetch_query(args.gerrit, "hashtag:{0}".format(args.hashtag)) + change_numbers = [ + str(r["number"]) for r in sorted(reviews, key=cmp_to_key(cmp_reviews)) + ] elif args.query: reviews = fetch_query(args.gerrit, args.query) change_numbers = [