Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The title must sound strange but I'm trying to achieve the following:

SVN repo location: /home/flx/svn/flxdev SVN repo "flxdev" structure:

 + Project1
 ++ files
 + Project2
 + Project3
 + Project4

I'm trying to set up a post-commit hook that automatically checks out on the other end when I do a commit.

The post-commit doc explicitly lists the following:

# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit.  Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#
#   [1] REPOS-PATH   (the path to this repository)
#   [2] REV          (the number of the revision just committed)

So I made the following command to test:

REPOS="$1"
REV="$2"
echo "Updated project $REPOS to $REV"

However when I edit files in Project1 for example, this outputs "Updated project /home/flx/svn/flxdev to 1016"

I'd like this to be: "Updated project Project1 to 1016"

Having this variable allows me to specify to do different actions per project post-commit. How can I specify the project parameter?

Thanks!

Dennis

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Use svnlook.

Quick and dirty would be to try something like:

REPOS="$1"
REV="$2"
CHANGED_DIRS="`/usr/bin/svnlook -r $REV dirs-changed $REPOS`"

echo "Updated paths $CHANGED_DIRS in revision $REV"

You may want to try running svnlook help; it will list out the various commands you can use/information you can get.

share|improve this answer
    
Awesome, that's exactly what I need! Thanks! –  FLX Dec 22 '10 at 20:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.