Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set and manipulate custom svn revision property using hooks

I want to configure the following:

  1. When developers check-in code from their SVN client, a hook should verify whether it has a revision property "CodeReview" set along with the value of the property if it is set.
  2. If it is not set then add the revision property and set its value to "Not Done"
  3. When code review is done, update the property value to "Done".

I get error at step 1 itself. I tried by adding a pre-commit hook to check if the revision property is set. I am not able to do this in a pre-commit hook. I wrote a pre-commit.BAT file and used svn propget as below:

"C:\Program Files\Subversion\bin\svn.exe" propget "CodeReview" -t %TXN% %REPOS% >property FIND "%property%" "C:\repos\hooks\requiredproperties.txt">Null
If %ERRORLEVEL% EQU 0 goto OK1

This gives error -- complains about -t.

Can anyone help me with the scripts for the three steps?

like image 669
Yeshwant Avatar asked Sep 17 '25 04:09

Yeshwant


1 Answers

As already noted, you have to use svnlook on step 1. But situation is even more worse: it's strongly not recommended (while not prohibited) to modify transaction content in pre-commit hook in order to avoid unpredictable results, but you want to do it on your step 2

And, JFYI, property (any svn property) is attribute of file or directory, you tried to propget from transaction, which will be never successful

like image 62
Lazy Badger Avatar answered Sep 18 '25 16:09

Lazy Badger