autobump: add a dry-run option
Add an option for doing a dry-run. This allows script developers to see
what the script would do without actually opening up pull requests.
Change-Id: I78f720eb002ee38dc3ca76b1857c6ce08fbe7e95
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/infra/openbmc-autobump.py b/infra/openbmc-autobump.py
index 243a73e..3b57209 100755
--- a/infra/openbmc-autobump.py
+++ b/infra/openbmc-autobump.py
@@ -151,7 +151,8 @@
git.commit(sh.echo(commit_msg), '-s', '-F', '-', _cwd=meta)
push_args = ['origin', 'HEAD:refs/for/{}/autobump'.format(args.branch)]
- git.push(*push_args, _cwd=meta)
+ if not args.dry_run:
+ git.push(*push_args, _cwd=meta)
def main():
@@ -170,6 +171,9 @@
parser.set_defaults(branch='master')
parser.add_argument(
+ '-d', '--dry-run', dest='dry_run', action='store_true',
+ help='perform a dry run only')
+ parser.add_argument(
'-m', '--meta-repository', dest='meta_repository', action='append',
help='meta repository to check for updates')
parser.add_argument(