USVN

Userfriendly SVN
It is currently Wed Sep 08, 2010 6:46 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: HOWTO: Add a hook to all created projects
PostPosted: Wed Mar 10, 2010 10:57 pm 
Offline

Joined: Wed Mar 10, 2010 10:33 pm
Posts: 2
Location: Canada
We recently decided to make all projects run a particular post-commit hook script; Rather than remembering to add a link to the script each time we created a project, USVN was modified to do this for us.
How I did this was simple:
In library/USVN/Project.php there is (ln ~52, createProjectSVN()):
Code:
if ($tmp_path === $path . DIRECTORY_SEPARATOR) {
        @mkdir($path, 0700, true);
        USVN_SVNUtils::createSVN($path);
        if ($create_dir) {
                USVN_SVNUtils::createStandardDirectories($path);
        }
} else {

Right after the end of the $create_dir IF statement, I added a call to symlink(), like so:
Code:
if ($tmp_path === $path . DIRECTORY_SEPARATOR) {
        @mkdir($path, 0700, true);
        USVN_SVNUtils::createSVN($path);
        if ($create_dir) {
                USVN_SVNUtils::createStandardDirectories($path);
        }
        symlink('/var/svn/post-commit-hook.sh', $path.'/hooks/post-commit');
} else {

Note that for the time being, you will also have to edit removeDirectory() in DirectoryUtils due to a bug.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group