commit/galaxy-central: Dave Bouvier: Handle the case where the repository being installed has a newer downloadable changeset revision available. (Generally restricted to the new tool_dependency_definition repository type)
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/22a4f03c1fe4/ Changeset: 22a4f03c1fe4 User: Dave Bouvier Date: 2013-08-28 15:54:45 Summary: Handle the case where the repository being installed has a newer downloadable changeset revision available. (Generally restricted to the new tool_dependency_definition repository type) Affected #: 1 file diff -r 29110e49c311339c521525f0b0884ce8eb172129 -r 22a4f03c1fe40dedcb7e6f11510d58ada8e9c458 lib/tool_shed/galaxy_install/repository_util.py --- a/lib/tool_shed/galaxy_install/repository_util.py +++ b/lib/tool_shed/galaxy_install/repository_util.py @@ -214,24 +214,39 @@ def get_repo_info_dict( trans, repository_id, changeset_revision ): repository = suc.get_repository_in_tool_shed( trans, repository_id ) + repo_dir = repository.repo_path( trans.app ) + repo = hg.repository( suc.get_configured_ui(), repo_dir ) repository_clone_url = suc.generate_clone_url_for_repository_in_tool_shed( trans, repository ) repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision ) - metadata = repository_metadata.metadata - if 'tools' in metadata: - includes_tools = True + if not repository_metadata: + # The received changeset_revision is no longer installable, so get the next changeset_revision in the repository's changelog. + # This generally occurs only with repositories of type tool_dependency_definition. + next_downloadable_changeset_revision = suc.get_next_downloadable_changeset_revision( repository, repo, changeset_revision ) + if next_downloadable_changeset_revision: + repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, next_downloadable_changeset_revision ) + if repository_metadata: + # For now, we'll always assume that we'll get repository_metadata, but if we discover our assumption is not valid we'll have to + # enhance the callers to handle repository_metadata values of None in the returned repo_info_dict. + metadata = repository_metadata.metadata + if 'tools' in metadata: + includes_tools = True + else: + includes_tools = False + includes_tools_for_display_in_tool_panel = repository_metadata.includes_tools_for_display_in_tool_panel + if 'repository_dependencies' in metadata: + has_repository_dependencies = True + else: + has_repository_dependencies = False + if 'tool_dependencies' in metadata: + includes_tool_dependencies = True + else: + includes_tool_dependencies = False else: + # Here's where we may have to handle enhancements to the callers. See above comment. includes_tools = False - includes_tools_for_display_in_tool_panel = repository_metadata.includes_tools_for_display_in_tool_panel - if 'repository_dependencies' in metadata: - has_repository_dependencies = True - else: has_repository_dependencies = False - if 'tool_dependencies' in metadata: - includes_tool_dependencies = True - else: includes_tool_dependencies = False - repo_dir = repository.repo_path( trans.app ) - repo = hg.repository( suc.get_configured_ui(), repo_dir ) + includes_tools_for_display_in_tool_panel = False ctx = suc.get_changectx_for_changeset( repo, changeset_revision ) repo_info_dict = create_repo_info_dict( trans=trans, repository_clone_url=repository_clone_url, Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org