@staticmethod
def version_info_from_coverage_data(coverage):
    """
        Extract various version fields from the given coverage data.

        Certain coverage data formats store version information in the data,
        e.g. the revision or the branch. This method is used by the submit
        method to extract this information.

        The extracted fields currently include:

        revision
        branch

        @type coverage: string
        @param coverage: Coverage Data

        @return Dictionary with version data
        @rtype dict
        """
    ret = {}
    if 'git' in coverage and 'head' in coverage['git']:
        ret['revision'] = coverage['git']['head']['id']
        ret['branch'] = coverage['git']['branch']
        return ret
    else:
        raise RuntimeError('Unknown coverage format')
