Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrilRBS committed Jan 10, 2025
1 parent 6d63a69 commit 493cf31
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions conan/api/conan_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def __init__(self, cache_folder=None):

def reinit(self):
self.config.reinit()
self.config.migrate()
self.remotes.reinit()
self.local.reinit()

Expand Down
1 change: 0 additions & 1 deletion conan/api/subapi/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ def get_backup_sources(self, package_list=None, exclude=True, only_upload=True):
return download_cache.get_backup_sources_files(excluded_urls, package_list, only_upload)



def _resolve_latest_ref(cache, ref):
if ref.revision is None or ref.revision == "latest":
ref.revision = None
Expand Down
3 changes: 1 addition & 2 deletions conan/api/subapi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,12 @@ def appending_recursive_dict_update(d, u):

def migrate(self):
# Migration system
# TODO: Still needs refactoring - using it here for now for tests
# TODO: A prettier refactoring of migrators would be nice
from conans.client.migrations import ClientMigrator
migrator = ClientMigrator(self.home(), conan_version)
migrator.migrate()

def clean(self):
# TODO: Check what we're deleting
contents = os.listdir(self.home())
for content in contents:
# keep packages
Expand Down
8 changes: 2 additions & 6 deletions conan/cli/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,5 @@ def config_clean(conan_api, parser, subparser, *args):
"""
Clean the configuration files in the Conan home folder. (Keeping installed packages)
"""
subparser.add_argument("-c", "--confirm", action='store_true',
help="Do not request confirmation")
args = parser.parse_args(*args)
ui = UserInput(conan_api.config.get("core:non_interactive"))
if args.confirm or ui.request_boolean("Clear all configuration files?"):
conan_api.config.clean()
parser.parse_args(*args)
conan_api.config.clean()
2 changes: 1 addition & 1 deletion test/integration/command/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_config_clean():
"extensions/compatibility/mycomp.py": "",
"extensions/commands/cmd_foo.py": "",
})
tc.run("config clean -c")
tc.run("config clean")
tc.run("profile list")
assert "foo" not in tc.out
tc.run("remote list")
Expand Down

0 comments on commit 493cf31

Please # to comment.