def create_failing_post_commit_hook(repo_dir): """Disable commits in a repository REPOS_DIR by creating a post-commit hook script which always reports errors.""" hook_path = main.get_post_commit_hook_path(repo_dir) main.create_python_hook_script( hook_path, 'import sys; ' 'sys.stderr.write("Post-commit hook failed"); ' 'sys.exit(1)')
def enable_revprop_changes(repo_dir): """Enable revprop changes in a repository REPOS_DIR by creating a pre-revprop-change hook script and (if appropriate) making it executable.""" hook_path = main.get_pre_revprop_change_hook_path(repo_dir) main.create_python_hook_script(hook_path, 'import sys; sys.exit(0)')