def annotate_metadata_action(repo):
package = repo.package    <EOL>print("<STR_LIT>")<EOL>with cd(repo.rootdir): <EOL><INDENT>filename = "<STR_LIT>"        <EOL>if os.path.exists(filename):             <EOL><INDENT>history = open(filename).readlines() <EOL>actions = []<EOL>for a in history: <EOL><INDENT>try: <EOL><INDENT>a = json.loads(a)<EOL>for x in ['<STR_LIT:code>']: <EOL><INDENT>if x not in a or a[x] == None: <EOL><INDENT>a[x] = "<STR_LIT>"<EOL><DEDENT><DEDENT>actions.append(a)<EOL><DEDENT>except:<EOL><INDENT>pass <EOL><DEDENT><DEDENT>package['<STR_LIT>'] = actions<EOL><DEDENT><DEDENT>
Update metadata with the action history