def archive_history_item(item, destination, no_color):
log_src, description = split_history_item(item.strip())<EOL>log_dest = os.path.sep.join(log_src.rsplit(os.path.sep, <NUM_LIT:4>)[<NUM_LIT:1>:])<EOL>results_src = log_src.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>] + '<STR_LIT>'<EOL>results_dest = log_dest.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>] + '<STR_LIT>'<EOL>destination_path = os.path.join(destination, log_dest)<EOL>log_dir = os.path.dirname(destination_path)<EOL>try:<EOL><INDENT>if not os.path.isdir(log_dir):<EOL><INDENT>os.makedirs(log_dir)<EOL><DEDENT>shutil.copyfile(log_src, destination_path)<EOL>shutil.copyfile(results_src, os.path.join(destination, results_dest))<EOL><DEDENT>except Exception as error:<EOL><INDENT>echo_style(<EOL>'<STR_LIT>' % error,<EOL>no_color,<EOL>fg='<STR_LIT>'<EOL>)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>update_history_log(<EOL>os.path.join(destination, '<STR_LIT>'),<EOL>description=description,<EOL>test_log=log_dest<EOL>)<EOL><DEDENT>
Archive the log and results file for the given history item.

Copy the files and update the results file in destination directory.