def fix_rev(repo_dir, rev): """""" check_formats(repo_dir) # Back up the file if not os.path.exists(rev_file_path(repo_dir, rev) + '.orig'): pass # cp -a "$FILE" "$FILE.orig" # Keep looking for verification errors in r$REV and fixing them while we can. while fix_one_error(repo_dir, rev): pass print "Revision " + rev + " verifies OK."
def replace_in_rev_file(repo_dir, rev, old, new): rev_file = rev_file_path(repo_dir, rev) replace_in_file(rev_file, old, new)
def replace_in_rev_file(repo_dir, rev, old, new): """Replace all occurrences of the string OLD with the string NEW in the revision file for revision REV in the repository at REPO_DIR. Raise an error if nothing changes.""" rev_file = rev_file_path(repo_dir, rev) replace_in_file(rev_file, old, new)