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

RE: Add text to commit log

From: Hansa <mythtv_at_logic-q.nl>
Date: Tue, 11 Mar 2008 19:26:04 +0100

Ok.. I've figured it out. I think :)

The final part of my last e-mail isn't entirely correct.
You should make a combination between a post-commit hook and a
post-revprop-change hook. Why? Because you want to change the "svn:log"
property after you've committed a revision.

Properties (via svn propset) can be set on files, dirs, or revisions. Also
"svn propset" acts on "working copies" or via a URL on the repository. "svn
propset" does NOT act directly on the repository path.

 svn propset svn:log --revprop -r $REV $PROPVAL /path/to/repository
                                                ^^ does not work ^^
Here is what you should do:

# cd /path/to/svn/repos/hooks
# cp post-commit.tmpl post-commit
# chmod 755 post-commit

edit post-commit and make it look something like this:

 REPOS="$1"
 REV="$2"

 # Modify REPOS to svn/html URL
 REPOS=`echo $REPOS | sed 's/\/path\/to\/repos\///'`
 REPOS="svn://svnserve.url/$REPOS"
 # or:
 #REPOS="http://svn.appache.url/$REPOS"

 svn propset svn:log --revprop -r $REV \"new log\" $REPOS

Save.

# cp pre-revprop-change.tmpl pre-revprop-change
# chmod 755 pre-revprop-change

edit pre-revprop-change:

 REPOS="$1"
 REV="$2"
 USER="$3"
 PROPNAME="$4"
 ACTION="$5"

 if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
 if [ "$ACTION" = "A" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
 # You could combine -a and -o, but I didn't want to :)

 echo "Changing revision properties other than svn:log is prohibited" >&2
 exit 1

Save and you're done (I think) :)

Try it and let me know if this works...

Hansa

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-11 19:26:50 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.