LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   svn: Value will not be set unless forced (https://www.linuxquestions.org/questions/programming-9/svn-value-will-not-be-set-unless-forced-568716/)

senyahnoj 07-12-2007 07:29 AM

svn: Value will not be set unless forced (solved)
 
I'm trying to retrospectively change the author property of certain revisions in my subversion repository.

I run:
Code:

svn propedit -r 185 --revprop svn:author
...which gives me the svn:author property to edit in vim, when I save and close this I get

Code:

svn: Value will not be set unless forced
Does anyone know how to force this?

i_grok 07-12-2007 08:55 AM

If you don't already know about them, each svn command has a help page. For 'propedit', use 'svn help propedit'.

As you'll see there, you can force operations using '--force'.

Usually if something needs to be forced with svn you should make sure you're doing things the 'right way'. These properties are not revision controlled the way everything else in the repository is. Once you've changed it, the old settings are lost.

senyahnoj 07-12-2007 09:31 AM

Thanks, for some reason I totally missed seeing that on svn help propedit - either going blind or stupid..

Now I get:
Code:

$ svn propedit --force -r 185 --revprop svn:author
svn: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
svn: At least one property change failed; repository is unchanged

The pre-revprop-change hook script on the server is

Code:

#!/bin/sh

# contents of /home/svn/hooks/pre-revprop-change
# owned and executable by apache

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

if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:author" ]; then exit 0; fi

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


i_grok 07-13-2007 08:38 PM

You also have to make sure the script is actually executable. By default, the hook scripts are NOT executable. Just do a 'chmod 755 pre-revprop-change'.

senyahnoj 07-15-2007 01:39 PM

it already is - any other ideas?

senyahnoj 07-17-2007 05:04 AM

solved! - post-revprop-change was looking for a perl script it didn't have: propchange-email.pl

located this on the filesystem, copied it to my hook scripts directory and edited post-revprop-change to

Code:

/home/svn/hooks/propchange-email.pl "$REPOS" "$REV" "$USER" "$PROPNAME" watchers@example.org


All times are GMT -5. The time now is 10:01 PM.