def get_latest_downloadable_changeset_revision_via_api(url, name, owner):
 error_message = ''
 parts = ['api', 'repositories', 'get_ordered_installable_revisions']
 params = dict(name=name, owner=owner)
 api_url = get_api_url(base=url, parts=parts, params=params)
 (changeset_revisions, error_message) = json_from_url(api_url)
 if ((changeset_revisions is None) or error_message):
  return (None, error_message)
 if (len(changeset_revisions) >= 1):
  return (changeset_revisions[(-1)], error_message)
 return (hg_util.INITIAL_CHANGELOG_HASH, error_message)

def get_latest_downloadable_changeset_revision_via_api ( url , name , owner ) : error_message = '' parts = [ 'api' , 'repositories' , 'get_ordered_installable_revisions' ] params = dict ( name = name , owner = owner ) api_url = get_api_url ( base = url , parts = parts , params = params ) ( changeset_revisions , error_message ) = json_from_url ( api_url ) if ( ( changeset_revisions is None ) or error_message ) : return ( None , error_message ) if ( len ( changeset_revisions ) >= 1 ) : return ( changeset_revisions [ ( - 1 ) ] , error_message ) return ( hg_util . INITIAL_CHANGELOG_HASH , error_message )
return the latest downloadable changeset revision for the repository defined by the received name and owner .