[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Patch] custom location for hook directory

From: Joshua Varner <jlvarner_at_gmail.com>
Date: 2005-09-19 01:02:14 CEST

I realize I should have brought up an potential design on
the list first, but it turned out to be pretty simple.

I do have one question with regard to pool usage,
should I have used a subpool for the file reading
part of the patch. I based it on svn_io_read_version_file,
so, if yes, that function should probably be changed
as well.

[[[

If the default hook directory path points to a file,
read the first line of that file and use it as the path
to the hook directory. Resolves Issue: 2294.

Patch By: Joshua Varner
Review By:

* subversion/libsvn_repos/repos.c
  (check_hook_location): New Function.
  (get_repos): Use It.

]]]

I tested this change with the following script. I can
convert it to a test, but that will take some time (I
haven't learned python yet). Issue 2294, also, talks
about symlinked hook directories, but those
work on linux with the trunk, so someone must
have fixed that already, I made a note on the issue
already about that.

Josh

rm -rf test-repos test-wc hook-out
REPO=$PWD/test-repos
REPOURL=file://$REPO
HOOKWRITEFILE=$PWD/hook-out
touch $HOOKWRITEFILE
chmod 777 $HOOKWRITEFILE

svnadmin create test-repos
svn co $REPOURL test-wc

echo "#! /bin/sh" >> $REPO/hooks/pre-commit
echo "echo \$1 \$2 >> $HOOKWRITEFILE" >> $REPO/hooks/pre-commit
chmod +x $REPO/hooks/pre-commit

cd test-wc
echo New File > file2
svn add file2
svn commit -m "Hi what happened"

cat $HOOKWRITEFILE

mv $REPO/hooks $REPO/hooks2
echo $REPO/hooks2 > $REPO/hooks

echo more stuff >> file2
svn commit -m "Second commit"

cat $HOOKWRITEFILE

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Mon Sep 19 01:02:54 2005

This is an archived mail posted to the Subversion Dev mailing list.