Read about our upcoming Code of Conduct on this issue

Commit 6981bec1 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

convert_git_tags_push: new option to skip confirmation

will be useful for full automation
parent dd6eade34648
......@@ -46,6 +46,8 @@
parser.add_argument("-s", "--simulate", action="store_true",
help="Don't commit nor push, rollback changes "
"to the tags file instead.")
parser.add_argument("--force-confirm", action="store_true",
help="Do not prompt user for confirmation.")
parser.add_argument("--logging-level", default='INFO')
parser.add_argument("-R", "--repository", default=".",
help="Mercurial repository to operate on.")
......@@ -79,12 +81,13 @@
remote = check_output(('hg', 'config', 'paths.default')).strip().decode()
sys.stdout.buffer.write(diff)
confirmation = input("Commit and push those changes to '%s'?\n"
"Please enter 'YES' to confirm: " % remote)
if confirmation.strip() != 'YES':
revert()
logger.warning("Not confirmed, changes reverted. Bye")
return 0
if not cl_args.force_confirm:
confirmation = input("Commit and push those changes to '%s'?\n"
"Please enter 'YES' to confirm: " % remote)
if confirmation.strip() != 'YES':
revert()
logger.warning("Not confirmed, changes reverted. Bye")
return 0
if simulate:
logger.info("Simulation mode: reverting .hgtags")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment