def Commit(change_info, args):
  if not change_info.FileList():
    print "Nothing to commit, changelist is empty."
    return

  if not args in "--no_presubmit":
    if not DoPresubmitChecks(change_info, committing=True):
      return
  else:
    args.remove("--no_presubmit")

  no_tree_status_check = ("--force" in args or "-f" in args)
  if not no_tree_status_check and not IsTreeOpen():
    print ("Error: The tree is closed. Try again later or use --force to force"
           " the commit. May the --force be with you.")
    return

  commit_cmd = ["svn", "commit"]
  filename = ''
  if change_info.issue:
    # Get the latest description from Rietveld.
    change_info.description = GetIssueDescription(change_info.issue)

  commit_message = change_info.description.replace('\r\n', '\n')
  if change_info.issue:
    commit_message += ('\nReview URL: http://%s/%s' %
                       (GetCodeReviewSetting("CODE_REVIEW_SERVER"),
                        change_info.issue))

  handle, commit_filename = tempfile.mkstemp(text=True)
  os.write(handle, commit_message)
  os.close(handle)

  handle, targets_filename = tempfile.mkstemp(text=True)
  os.write(handle, "\n".join(change_info.FileList()))
  os.close(handle)

  commit_cmd += ['--file=' + commit_filename]
  commit_cmd += ['--targets=' + targets_filename]
  # Change the current working directory before calling commit.
  previous_cwd = os.getcwd()
  os.chdir(GetRepositoryRoot())
  output = RunShell(commit_cmd, True)
  os.remove(commit_filename)
  os.remove(targets_filename)
  if output.find("Committed revision") != -1:
    change_info.Delete()

    if change_info.issue:
      revision = re.compile(".*?\nCommitted revision (\d+)",
                            re.DOTALL).match(output).group(1)
      viewvc_url = GetCodeReviewSetting("VIEW_VC")
      change_info.description = (change_info.description +
                                 "\n\nCommitted: " + viewvc_url + revision)
      change_info.CloseIssue()
  os.chdir(previous_cwd)
dataset/ETHPy150Open CollabQ/CollabQ/bin/gcl.py/Commit/swapped operands of `in`