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
conan search <pattern> --revisions with cache Issue/5472 #5537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There are no tests: Test the feature, test the --revisions with --remote and not ref
- I suspect that the search.py will crash for editable packages when gathering the revision?
- I would avoid passing the
with_revision
argument, thesearch_recipes
could return always a reference with the revision filled (if any). So the "print_revision" argument would be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would try to make the local search return the revisions always, I think it should simplify the things and doesn't look very dangerous: https://github.com/conan-io/conan/compare/develop...lasote:delete/test_search?expand=1
@@ -1194,6 +1194,10 @@ class Test(ConanFile): | |||
client.run("search lib/1.0@user/testing --revisions") | |||
self.assertIn("bd761686d5c57b31f4cd85fd0329751f (No time)", client.out) | |||
|
|||
# test that the pattern search with --revisions enabled works | |||
client.run("search li* --revisions") | |||
self.assertIn("bd761686d5c57b31f4cd85fd0329751f (No time)", client.out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it lib/1.0@user/testing#bd761686d5c57b31f4cd85fd0329751f (No time)
? In that case assert the whole line because it is confusing what is bd761686d5c57b31f4cd85fd0329751f
conans/client/conan_api.py
Outdated
@@ -1093,7 +1093,7 @@ def get_remote_by_name(self, remote_name): | |||
return self._cache.registry.load_remotes()[remote_name] | |||
|
|||
@api_method | |||
def get_recipe_revisions(self, reference, remote_name=None): | |||
def get_recipe_revisions(self, reference, remote_name=None, check_rev_time=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't change this method. That check_rev_time
is a patch.
conans/client/command.py
Outdated
info = self._conan.search_recipes(args.pattern_or_reference, | ||
remote_name=args.remote, | ||
case_sensitive=args.case_sensitive) | ||
if info["results"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels hacky too
Changelog: Feature: Output current revision from references in local cache when using a pattern
Docs: conan-io/docs#1381
Previous behaviour was that current revision number could only be shown if a reference was
given with the
--revisions
argument but not a pattern.Now you can use a pattern to list the current revision of the references in the local cache.
Closes #5472
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.