Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing remote clean without user/channel #5607

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conans/client/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, cache_folder, output):

def all_refs(self):
subdirs = list_folder_subdirs(basedir=self._store_folder, level=4)
return [ConanFileReference(*folder.split("/")) for folder in subdirs]
return [ConanFileReference.load_dir_repr(folder) for folder in subdirs]

@property
def store(self):
Expand Down
18 changes: 17 additions & 1 deletion conans/test/functional/command/remote_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class HelloConan(ConanFile):

def list_raw_test(self):
self.client.run("remote list --raw")
output = re.sub("http:\/\/fake.+\.com", "http://fake.com", str(self.client.out))
output = re.sub(r"http:\/\/fake.+\.com", "http://fake.com", str(self.client.out))
self.assertIn("remote0 http://fake.com True", output)
self.assertIn("remote1 http://fake.com True", output)
self.assertIn("remote2 http://fake.com True", output)
Expand Down Expand Up @@ -157,6 +157,22 @@ def clean_remote_test(self):
self.client.run("remote list_ref")
self.assertEqual("", self.client.out)

def clean_remote_no_user_test(self):
self.client.run("remote add_ref Hello/0.1 remote0")
self.client.run("remote clean")
self.client.run("remote list")
self.assertEqual("", self.client.out)
self.client.run("remote list_ref")
self.assertEqual("", self.client.out)

def remove_remote_no_user_test(self):
self.client.run("remote add_ref Hello/0.1 remote0")
self.client.run("remote remove remote0")
self.client.run("remote list")
self.assertNotIn("remote0", self.client.out)
self.client.run("remote list_ref")
self.assertEqual("", self.client.out)

def add_force_test(self):
client = TestClient()
client.run("remote add r1 https://r1")
Expand Down