From 682a4057c0efb9730f63550a02fb97613c54b870 Mon Sep 17 00:00:00 2001 From: Dawid Ciecierski Date: Fri, 11 Apr 2014 06:03:06 +0200 Subject: [PATCH] Revprop change Windows example For completeness a plug-and-play version of a repository hook required for preserving revision dates and authors. --- hook-examples/pre-revprop-change_example.bat | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 hook-examples/pre-revprop-change_example.bat diff --git a/hook-examples/pre-revprop-change_example.bat b/hook-examples/pre-revprop-change_example.bat new file mode 100644 index 0000000..91e84bf --- /dev/null +++ b/hook-examples/pre-revprop-change_example.bat @@ -0,0 +1,29 @@ +@echo off +setlocal + +set REPOS=%~1 +set REV=%~2 +set USER=%~3 +set PROPNAME=%~4 +set ACTION=%~5 + +rem Print out some debug info +echo pre-revprop-change: REPOS=%REPOS% REV=%REV% USER=%USER% PROPNAME=%PROPNAME% ACTION=%ACTION% >&2 + +rem Allow modifying certain properties +if "%PROPNAME%" == "svn:author" goto ALLOW +if "%PROPNAME%" == "svn:date" goto ALLOW + +rem Reject everyting else +goto DENY + +:DENY +echo Not allowed to change %PROPNAME% >&2 +endlocal +@echo on +exit 1 + +:ALLOW +endlocal +@echo on +exit 0 \ No newline at end of file -- 2.45.2