update.py: allow to disable autocommit (#119182)
This commit is contained in:
parent
1d0542c07b
commit
3eb8f4d15c
|
@ -460,6 +460,10 @@ def parse_args(editor: Editor):
|
||||||
default=30,
|
default=30,
|
||||||
help="Number of concurrent processes to spawn.",
|
help="Number of concurrent processes to spawn.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--no-commit", "-n", action="store_true", default=False,
|
||||||
|
help="Whether to autocommit changes"
|
||||||
|
)
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
@ -504,10 +508,15 @@ def update_plugins(editor: Editor):
|
||||||
|
|
||||||
redirects = update()
|
redirects = update()
|
||||||
rewrite_input(args.input_file, editor.deprecated, redirects)
|
rewrite_input(args.input_file, editor.deprecated, redirects)
|
||||||
|
|
||||||
|
autocommit = not args.no_commit
|
||||||
|
|
||||||
|
if autocommit:
|
||||||
commit(nixpkgs_repo, f"{editor.name}Plugins: update", [args.outfile])
|
commit(nixpkgs_repo, f"{editor.name}Plugins: update", [args.outfile])
|
||||||
|
|
||||||
if redirects:
|
if redirects:
|
||||||
update()
|
update()
|
||||||
|
if autocommit:
|
||||||
commit(
|
commit(
|
||||||
nixpkgs_repo,
|
nixpkgs_repo,
|
||||||
f"{editor.name}Plugins: resolve github repository redirects",
|
f"{editor.name}Plugins: resolve github repository redirects",
|
||||||
|
@ -518,6 +527,7 @@ def update_plugins(editor: Editor):
|
||||||
rewrite_input(args.input_file, editor.deprecated, append=(plugin_line + "\n",))
|
rewrite_input(args.input_file, editor.deprecated, append=(plugin_line + "\n",))
|
||||||
update()
|
update()
|
||||||
plugin = fetch_plugin_from_pluginline(plugin_line)
|
plugin = fetch_plugin_from_pluginline(plugin_line)
|
||||||
|
if autocommit:
|
||||||
commit(
|
commit(
|
||||||
nixpkgs_repo,
|
nixpkgs_repo,
|
||||||
"{editor}Plugins.{name}: init at {version}".format(
|
"{editor}Plugins.{name}: init at {version}".format(
|
||||||
|
|
Loading…
Reference in a new issue