def get_revision_metadata(changeset, metadata_property_map=None, repository_uri=None, encoding="utf-8"):
    """
    Return dictionary of metadatas defined in metadata_property_map.

    Uses slow solution (git log query per property) to avoid "delimiter inside result" problem.
    """
    
    # it looks like git is displaying time in en_US locale even if, i.e. cs_CZ
    # is set, which is bad when using with %a or %b...so hack it
    
    setlocale(LC_ALL, USED_GIT_PARSING_LOCALE)

    metadata = {
        "repository_uri" : repository_uri or get_repository_uri()
    }

    metadata_property_map = metadata_property_map or {
        "%h" : {'name' : "hash_abbrev"},
        "%H" : {'name' : "hash"},
        "%aN" : {'name' : "author_name"},
        "%ae" : {'name' : "author_email"},
        "%ad" : {'name' : "author_date", 'filter' : filter_parse_date},
        "%cN" : {'name' : "commiter_name"},
        "%ce" : {'name' : "commiter_email"},
        "%cd" : {'name' : "commiter_date", 'filter' : filter_parse_date},
        "%s" : {'name' : "subject"},

    }

    for property in metadata_property_map:
        if 'filter' in metadata_property_map[property]:
            filter = metadata_property_map[property]['filter']
        else:
            filter = None
        try:
            metadata[metadata_property_map[property]['name']] = get_revision_metadata_property(changeset, property, filter)
        except (CalledProcessError, __HOLE__):
            metadata[metadata_property_map[property]['name']] = "[failed to retrieve]"
            log.error("Error when parsing metadata: %s" % traceback.format_exc())

    resetlocale()
    return metadata
dataset/ETHPy150Open ella/citools/citools/git.py/get_revision_metadata