svnpost-commitsvnlook

Using SVN post-commit to update a .txt file


First of all, i am on Windows 7, if that makes a difference, using Cygwin. I'am using a dropbox as my svn repo, where i can manage multiple projects. After each commit to each projects, i want to update a file changelog.txt in public_root folder, and if it's possible, commit the changes made after post-commit script.

post-commit file located under /hooks folder in svn repo:

#!/bin/sh

REPOS=$1
REV=$2

/usr/bin/svnlook info $REPOS >> $REPOS/changelog.txt

Actually it place a changelog.txt into svn repo folder, what i want is to put it inside the folder of my checked out project (sorry for not knowing the right terms to describe)

Any advice ?


Solution

  • $REPOS refers to the location of the whole repository and not a checked out copy. The Subversion server cannot possibly know where the client is going to write the data.

    It is also not possible to modify the repository itself upon committing (as modifying a file).

    If you are the only user of the repository and you always check out the stuff in the same sandbox you can hard-code the location in your post-commit hook

    /usr/bin/svnlook info $REPOS >> /the/location/of/my/sandbox/changelog.txt