def store(config, archiver, revision, stats):
root = pathlib.Path(config.cache_path) / archiver.name<EOL>if not root.exists():<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>root.mkdir()<EOL><DEDENT>if config.path != "<STR_LIT:.>":<EOL><INDENT>for operator, operator_data in list(stats["<STR_LIT>"].items()):<EOL><INDENT>if operator_data:<EOL><INDENT>new_operator_data = operator_data.copy()<EOL>for k, v in list(operator_data.items()):<EOL><INDENT>new_key = os.path.relpath(str(k), str(config.path))<EOL>del new_operator_data[k]<EOL>new_operator_data[new_key] = v<EOL><DEDENT>del stats["<STR_LIT>"][operator]<EOL>stats["<STR_LIT>"][operator] = new_operator_data<EOL><DEDENT><DEDENT><DEDENT>logger.debug(f"<STR_LIT>")<EOL>filename = root / (revision.key + "<STR_LIT>")<EOL>if filename.exists():<EOL><INDENT>raise RuntimeError(f"<STR_LIT>")<EOL><DEDENT>with open(filename, "<STR_LIT:w>") as out:<EOL><INDENT>out.write(json.dumps(stats, indent=<NUM_LIT:2>))<EOL><DEDENT>return filename<EOL>
Store a revision record within an archiver folder.

:param config: The configuration
:type  config: :class:`wily.config.WilyConfig`

:param archiver: The name of the archiver type (e.g. 'git')
:type  archiver: ``str``

:param revision: The revision ID
:type  revision: ``str``

:param stats: The collected data
:type  stats: ``dict``

:return: The absolute path to the created file
:rtype: ``str``

:rtype: `pathlib.Path`