1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 16:55:07 -05:00

Add option to commit right away to accept.py

This commit is contained in:
Jonas Wielicki 2018-01-25 09:02:56 +01:00
parent 3c5caacd85
commit 0202f9166b

View File

@ -2,6 +2,7 @@
import pathlib
import re
import shutil
import subprocess
import sys
import xml.etree.ElementTree as etree
@ -121,6 +122,13 @@ def main():
help="Force acceptance even if suspicious.",
)
parser.add_argument(
"-c", "--commit",
default=False,
action="store_true",
help="Make a git commit",
)
parser.add_argument(
"item",
help="Inbox name"
@ -199,6 +207,26 @@ def main():
xepinfo["approver"],
args.votedate.date())
if args.commit:
subprocess.check_call([
"git", "reset", "HEAD", ".",
])
subprocess.check_call([
"git", "add", new_filename.parts[-1],
])
if args.ask:
flags = ["-ve"]
else:
flags = []
subprocess.check_call(
[
"git", "commit", "-m", "Accept {} as XEP-{:04}".format(
inbox_path,
new_number,
)
] + flags
)
if __name__ == "__main__":
main()