def modified_files(root, tracked_only=False, commit=None):
assert os.path.isabs(root), "<STR_LIT>" % root<EOL>command = ['<STR_LIT>', '<STR_LIT:status>']<EOL>if commit:<EOL><INDENT>command.append('<STR_LIT>' % commit)<EOL><DEDENT>status_lines = subprocess.check_output(command).decode('<STR_LIT:utf-8>').split(<EOL>os.linesep)<EOL>modes = ['<STR_LIT:M>', '<STR_LIT:A>']<EOL>if not tracked_only:<EOL><INDENT>modes.append(r'<STR_LIT>')<EOL><DEDENT>modes_str = '<STR_LIT:|>'.join(modes)<EOL>modified_file_status = utils.filter_lines(<EOL>status_lines,<EOL>r'<STR_LIT>' % modes_str,<EOL>groups=('<STR_LIT:filename>', '<STR_LIT>'))<EOL>return dict((os.path.join(root, filename), mode)<EOL>for filename, mode in modified_file_status)<EOL>
Returns a list of files that has been modified since the last commit.

    Args:
      root: the root of the repository, it has to be an absolute path.
      tracked_only: exclude untracked files when True.
      commit: SHA1 of the commit. If None, it will get the modified files in the
        working copy.

    Returns: a dictionary with the modified files as keys, and additional
      information as value. In this case it adds the status returned by
      hg status.