(path, project, new_rev, is_dry_run)
return old_rev
Update project_revision to |new_issue|.

  A bit hacky, could it be made better?
Update project_revision to |new_issue|.
Update project_revision to |new_issue| .
def process_deps(path, project, new_rev, is_dry_run):
  """Update project_revision to |new_issue|.

  A bit hacky, could it be made better?
  """
  content = open(path).read()
  # Hack for Blink to get the AutoRollBot running again.
  if project == "blink":
    project = "webkit"
  old_line = r"(\s+)'%s_revision': '([0-9a-f]{2,40})'," % project
  new_line = r"\1'%s_revision': '%s'," % (project, new_rev)
  new_content = re.sub(old_line, new_line, content, 1)
  old_rev = re.search(old_line, content).group(2)
  if not old_rev:
    die_with_error('Failed to update the DEPS file')

  if not is_dry_run and new_content != content:
    open(path, 'w').write(new_content)
  return old_rev
def process_deps ( path , project , new_rev , is_dry_run ) : content = open ( path ) . read ( ) # Hack for Blink to get the AutoRollBot running again. if project == "blink" : project = "webkit" old_line = r"(\s+)'%s_revision': '([0-9a-f]{2,40})'," % project new_line = r"\1'%s_revision': '%s'," % ( project , new_rev ) new_content = re . sub ( old_line , new_line , content , 1 ) old_rev = re . search ( old_line , content ) . group ( 2 ) if not old_rev : die_with_error ( 'Failed to update the DEPS file' ) if not is_dry_run and new_content != content : open ( path , 'w' ) . write ( new_content ) return old_rev