Skip to content

Commit

Permalink
migrate: always be interactive
Browse files Browse the repository at this point in the history
This way people can reject changes to their configs that they don't want
(or are potentially incorrect, viz. the discussion in qtile#2567).

Closes qtile#2353 (we're relying on people to reject incorrect migrations for
now)

Signed-off-by: Tycho Andersen <[email protected]>
  • Loading branch information
tych0 committed Jul 4, 2021
1 parent d8cbb2c commit d9e6a7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions libqtile/scripts/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def do_migrate(args):

for m in MIGRATIONS:
q = bowler.Query(config_dir)
m(q).execute(interactive=args.interactive, write=True)
m(q).execute(interactive=not args.yes, write=True)

changed = False
for py, backup in file_and_backup(config_dir):
Expand Down Expand Up @@ -193,8 +193,8 @@ def add_subcommand(subparsers, parents):
help="Use the specified configuration file (migrates every .py file in this directory)",
)
parser.add_argument(
"--interactive",
"--yes",
action="store_true",
help="Interactively apply diff (similar to git add -p)",
help="Automatically apply diffs with no confirmation",
)
parser.set_defaults(func=do_migrate)
2 changes: 1 addition & 1 deletion test/test_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def run_qtile_migrate(config):
cmd = os.path.join(os.path.dirname(__file__), '..', 'bin', 'qtile')
argv = [cmd, "migrate", "-c", config]
argv = [cmd, "migrate", "--yes", "-c", config]
subprocess.check_call(argv)


Expand Down

0 comments on commit d9e6a7d

Please sign in to comment.