parameters: (history)
return_statement: return result
docstring: copy release package to release resp
docstring_summary: copy release package to release resp
docstring_tokens: copy release package to release resp
function: def copy_package(history):
          '''
            copy release package to release resp
          '''
          result=list()
          if history.PackageID and not CITaskHistoryService.is_history_archived(history) :
              history_files=list()
              new_archive=CITaskHistoryService.new_archive(history,history_files)
              for old_file_id in eval(history.PackageID):
                  file_id=0
                  try:
                      file_id=FileInfoService.copy_file(old_file_id,PackgeMongoFile,ReleaseArchiveMongoFile)
                      result.append(file_id)
                      history_files.append(file_id)
                  except Exception as ex:
                      FileInfoService.delete_file(file_id, ReleaseArchiveMongoFile)
                      new_archive.delete()
                      SimpleLogger.exception(ex)
                      result=None
              
              if result:
                  file_ids=""
                  for file_id in history_files:
                      file_ids=file_ids+str(file_id)+","
                  new_archive.Archives=file_ids
                  new_archive.save()
          return result
function_tokens: def copy_package ( history ) : result = list ( ) if history . PackageID and not CITaskHistoryService . is_history_archived ( history ) : history_files = list ( ) new_archive = CITaskHistoryService . new_archive ( history , history_files ) for old_file_id in eval ( history . PackageID ) : file_id = 0 try : file_id = FileInfoService . copy_file ( old_file_id , PackgeMongoFile , ReleaseArchiveMongoFile ) result . append ( file_id ) history_files . append ( file_id ) except Exception as ex : FileInfoService . delete_file ( file_id , ReleaseArchiveMongoFile ) new_archive . delete ( ) SimpleLogger . exception ( ex ) result = None if result : file_ids = "" for file_id in history_files : file_ids = file_ids + str ( file_id ) + "," new_archive . Archives = file_ids new_archive . save ( ) return result