obmc-gerrit: Make topic optional
Make topic argument optional so that users do not have to specify a
topic.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: If743abeb6820a85d72a4d7049ba086f4d64635e5
diff --git a/amboar/obmc-scripts/maintainers/obmc-gerrit b/amboar/obmc-scripts/maintainers/obmc-gerrit
index 6cb24cb..f285f61 100755
--- a/amboar/obmc-scripts/maintainers/obmc-gerrit
+++ b/amboar/obmc-scripts/maintainers/obmc-gerrit
@@ -42,7 +42,7 @@
if reviewers:
argl.extend("r={}".format(addr) for addr in reviewers)
if topic:
- argl.append("topic={}".format(topic));
+ argl.append("topic={}".format(topic))
return ",".join(argl)
def decorate_refspec(refspec: str, topic: str) -> str:
@@ -63,7 +63,7 @@
push = subbies.add_parser("push", help="Push changes to Gerrit with reviewers")
push.add_argument("remote")
push.add_argument("refspec")
-push.add_argument("topic")
+push.add_argument("topic", nargs='?', default=None)
push.set_defaults(func=do_push)
args = parser.parse_args()