tag:blogger.com,1999:blog-315920831118778783.post2703022962479916557..comments2023-10-29T19:00:50.054+07:00Comments on while (true) { ; }: Enable Edit Log Message in SubversionHieu Le Trunghttp://www.blogger.com/profile/14528113575371376087noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-315920831118778783.post-41506419807741184892012-11-19T11:55:26.832+07:002012-11-19T11:55:26.832+07:00@flipdoubt, seems that "error" was cause...@flipdoubt, seems that "error" was caused by different reason, SVN_OWNER in Hieu Le Trung's post was gotten by parsing ..\Permission\authz-svn.conf, which obviously is not present neither in VisualSVN, nor in average SVN setup.<br /><br />I solved problem by simply setting up SVN_OWNER "by hands". Not a very good solution, but working. <br /><br />Other changes:<br />- allowed author to be changed<br />- changed messages to be more informative<br />- allowed addition of revprop (log message now), not only modification<br /><br />Here it is:<br /><br />:: Thanks to Hieu Le Trung http://changetheworldwithyourpassion.blogspot.com/<br /><br />@ECHO OFF<br />:: Set all parameters. Even though most are not used, in case you want to add<br />:: changes that allow, for example, editing of the author or addition of log messages.<br />set repository=%1<br />set revision=%2<br />set userName=%3<br />set propertyName=%4<br />set action=%5<br /><br />:: Only allow the log message and author to be changed, but not else.<br />if /I "%propertyName%" == "svn:log" goto PROPERTY_NAME_OK<br />if /I "%propertyName%" == "svn:author" goto PROPERTY_NAME_OK<br />goto ERROR_PROPNAME<br /><br />:PROPERTY_NAME_OK<br />:: Only allow modification or addition, but not deletion.<br />if /I "%action%" == "m" goto ACTION_OK<br />if /I "%action%" == "a" goto ACTION_OK<br />goto ERROR_ACTION<br /><br />:ACTION_OK<br />:: Make sure that the new revision property is not empty.<br />set bIsEmpty=true<br />for /f "tokens=*" %%g in ('find /V ""') do (<br />set bIsEmpty=false<br />)<br />if "%bIsEmpty%" == "true" goto ERROR_EMPTY<br /><br />FOR /F "tokens=*" %%a IN ('svnlook author "%repository%" -r %revision%') DO set REV_USER=%%a<br /><br />set SVN_OWNERS=HERE_GOES_LIST_OF_SPACE_SEPARATED_USERS_WHO_ARE_ALLOWED_TO_CHANGE_AUTHOR_REVPROP<br /><br />set bIsOK=false<br />FOR %%a IN (%SVN_OWNERS%) DO if "%%a"=="%userName%" ( set bIsOK=true )<br />if "%bIsOK%"=="false" (<br />goto ERROR_AUTHOR<br />)<br /><br />goto :eof<br /><br />:ERROR_AUTHOR<br />echo You authorised as "%userName%". To change revision property, you must be either the author of the log message ("%REV_USER%") or one of repository maintainers ("%SVN_OWNERS%"). >&2<br />goto ERROR_EXIT<br /><br />:ERROR_EMPTY<br />echo Empty revision properties are not allowed. >&2<br />goto ERROR_EXIT<br /><br />:ERROR_PROPNAME<br />echo Tried to change "%propertyName%" property. Only changes to svn:log and svn:author are allowed. >&2<br />goto ERROR_EXIT<br /><br />:ERROR_ACTION<br />echo Requested wrong action ("%action%"). Only modifications ("m") and additions ("d") are allowed. >&2<br />goto ERROR_EXIT<br /><br />:ERROR_EXIT<br />exit /b 1lynxnakehttps://www.blogger.com/profile/17317058231909038463noreply@blogger.comtag:blogger.com,1999:blog-315920831118778783.post-76070647940623667012012-11-19T11:52:23.472+07:002012-11-19T11:52:23.472+07:00This comment has been removed by the author.lynxnakehttps://www.blogger.com/profile/17317058231909038463noreply@blogger.comtag:blogger.com,1999:blog-315920831118778783.post-58470543637217709792009-08-27T05:03:43.048+07:002009-08-27T05:03:43.048+07:00@lynxnake, I'm not having any luck on VisualSV...@lynxnake, I'm not having any luck on VisualSVN Server either. Can you post a link to the fully revised script? Will this work if I am using Windows security?Unknownhttps://www.blogger.com/profile/16264749614668078410noreply@blogger.comtag:blogger.com,1999:blog-315920831118778783.post-3768603359264327302009-03-15T03:52:00.000+07:002009-03-15T03:52:00.000+07:00Didn't you forget to include %REV_USER% in the lin...Didn't you forget to include %REV_USER% in the line following?<BR/>FOR %%a IN (%SVN_OWNER%) DO if "%%a"=="%userName%" ( set bIsOK=true )<BR/><BR/>Without it script didn't work with my VisualSVN Server, 1.6.3lynxnakehttps://www.blogger.com/profile/17317058231909038463noreply@blogger.com