Skip to content

Commit

Permalink
Attempted fix for server error on repo preview.
Browse files Browse the repository at this point in the history
This should handle cases where the database record specifies a repository dependency, but the repository in question (and its downloadable changeset) has been updated since the dependency was created.
  • Loading branch information
davebx committed Apr 4, 2016
1 parent 463de48 commit 1aa8eb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tool_shed/util/metadata_util.py
Expand Up @@ -39,6 +39,10 @@ def get_dependencies_for_metadata_revision( app, metadata ):
dependencies = []
for shed, name, owner, changeset, prior, _ in metadata[ 'repository_dependencies' ]:
required_repository = suc.get_repository_by_name_and_owner( app, name, owner )
repo = hg_util.get_repo_for_repository( app, repository=required_repository, repo_path=None, create=False )
changeset = suc.get_next_downloadable_changeset_revision( required_repository, repo, changeset )
if changeset is None:
continue
metadata_entry = suc.get_repository_metadata_by_changeset_revision( app, app.security.encode_id( required_repository.id ), changeset )
dependencies.append( metadata_entry )
return dependencies
Expand Down

0 comments on commit 1aa8eb9

Please sign in to comment.