{"id":418,"date":"2013-01-10T02:19:58","date_gmt":"2013-01-10T07:19:58","guid":{"rendered":"http:\/\/jaewon.hwang.info\/jaewon\/?p=418"},"modified":"2013-01-10T02:20:27","modified_gmt":"2013-01-10T07:20:27","slug":"pre-revprop-change-hook-in-tortoisesvn","status":"publish","type":"post","link":"https:\/\/jaewon.hwang.info\/jaewon\/2013\/01\/pre-revprop-change-hook-in-tortoisesvn\/","title":{"rendered":"pre-revprop-change hook in TortoiseSVN"},"content":{"rendered":"<p>To edit a log of the committed revision in SVN, you need to unlock the pre-revprop-change hook. I found that the following two tips are very useful. In Windows, writing a batch script, pre-revprop-change.bat, in the hooks folder will do.<\/p>\n<p><!--more--><\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/1007012\/pre-revprop-change-hook-in-tortoisesvn\" target=\"_blank\">http:\/\/stackoverflow.com\/questions\/1007012\/pre-revprop-change-hook-in-tortoisesvn<\/a><\/p>\n<blockquote><p>In order to use the svn propedit command on a revision properly (like svn:log which is the log message property), you do need a pre-revprop-change hook, because the default behaviour is to deny revision property changes. The easiest way to add a pre-revprop-change hook is to make a copy of the pre-revprop-change.tmpl file (which you&#8217;ll find in \/repository-name\/hooks in your svn directory), call it pre-revprop-change and make it executable (chmod a+x).<\/p><\/blockquote>\n<p><a href=\"http:\/\/ayria.livejournal.com\/33438.html\" target=\"_blank\">http:\/\/ayria.livejournal.com\/33438.html<\/a><\/p>\n<pre class=\"brush: shell; toolbar: false;\">@ECHO OFF\r\n:: Set all parameters. Even though most are not used, in case you want to add\r\n:: changes that allow, for example, editing of the author or addition of log messages.\r\nset repository=%1\r\nset revision=%2\r\nset userName=%3\r\nset propertyName=%4\r\nset action=%5\r\n\r\n:: Only allow the log message to be changed, but not author, etc.\r\nif \/I not \"%propertyName%\" == \"svn:log\" goto ERROR_PROPNAME\r\n\r\n:: Only allow modification of a log message, not addition or deletion.\r\nif \/I not \"%action%\" == \"M\" goto ERROR_ACTION\r\n\r\n:: Make sure that the new svn:log message is not empty.\r\nset bIsEmpty=true\r\nfor \/f \"tokens=*\" %%g in ('find \/V \"\"') do (\r\nset bIsEmpty=false\r\n)\r\nif \"%bIsEmpty%\" == \"true\" goto ERROR_EMPTY\r\n\r\ngoto :eof\r\n\r\n:ERROR_EMPTY\r\necho Empty svn:log messages are not allowed. &gt;&amp;2\r\ngoto ERROR_EXIT\r\n\r\n:ERROR_PROPNAME\r\necho Only changes to svn:log messages are allowed. &gt;&amp;2\r\ngoto ERROR_EXIT\r\n\r\n:ERROR_ACTION\r\necho Only modifications to svn:log revision properties are allowed. &gt;&amp;2\r\ngoto ERROR_EXIT\r\n\r\n:ERROR_EXIT\r\nexit \/b 1<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To edit a log of the committed revision in SVN, you need to unlock the pre-revprop-change hook. I found that the following two tips are very useful. In Windows, writing a batch script, pre-revprop-change.bat, in the hooks folder will do.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[87],"class_list":["post-418","post","type-post","status-publish","format-standard","hentry","category-computer","tag-subversion"],"_links":{"self":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts\/418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/comments?post=418"}],"version-history":[{"count":0,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/posts\/418\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/media?parent=418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/categories?post=418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaewon.hwang.info\/jaewon\/wp-json\/wp\/v2\/tags?post=418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}