svn propset svn:log wont work for me.

2011-09-02 Thread douglas barrett
I am a new svn administrator and also the primary user.  I'm stuck on an issue 
which I can't resolve and would like some help.

On a server I have svn running which I access via apache.  I'm at revision 220 
on this particular repository so it seems to be mostly working correctly.  I 
flubbed the revision log on a check in (I like to associate svn revisions with 
bug IDs) and want to correct this, but running propset or propedit never 
succeed.

A bit of information about the server side set-up ...



[apache@X hooks]$ id
uid=48(apache) gid=48(apache) ...

apache@X hooks]$ pwd
Y/hooks

[apache@X hooks]$ ls -l pre-revprop-change
-rwxr-xr-x. 1 apache apache 2890 Sep  2 08:39 pre-revprop-change   
<< so I seem to have a valid hook

[apache@irvine hooks]$ tail -14 pre-revprop-change
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

echo "running" >/tmp/tmp
 << a test to see if the hook is run
exit 0; 
<< always succeed (as a debug aid)

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

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


I placed the two lines 'echo "running" >/tmp/tmp' and 'exit 0;' in the file as 
a debugging aid. 

[apache@X hooks]$ ls /tmp/tmp
ls: cannot access /tmp/tmp: No such file or directory   
   << I believe that running the hook would create this file

So whatever is going on I don't think the hook is even being run.  

---

On my work station I have the following output:


[dgb@Z c15]$ svn log -r220  
 << so I'm in a valid working directory and have repo access

r220 | dgb | 2011-09-01 16:13:26 -0700 (Thu, 01 Sep 2011) | 1 line

reslove bug 189


[dgb@Z c15]$ svn propset svn:log "a new comment" --revprop -r220
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
svn: Error setting property 'log': 
Revprop change blocked by pre-revprop-change hook (exit code 255) with no 
output.   << this is what I'd like to work

[dgb@Z c15]$ date
Fri Sep  2 10:04:15 PDT 2011
 << this is when the failure occurred 


Back on the server
[root@X httpd]# pwd
/var/log/httpd

[root@X httpd]# tail -4 error_log
[Fri Sep 02 08:51:32 2011] [error] [client 192.168.1.138] Revprop change 
blocked by pre-revprop-change hook (exit code 255) with no output.  [500, 
#165001]
[Fri Sep 02 08:51:32 2011] [error] [client 192.168.1.138] Could not execute 
PROPPATCH.  [500, #206]
[Fri Sep 02 08:51:32 2011] [error] [client 192.168.1.138] Revprop change 
blocked by pre-revprop-change hook (exit code 255) with no output.  [500, 
#165001]

<< there are errors, 
but they are old

<< (whatever that means)
[root@X httpd]# date
Fri Sep  2 10:00:13 PDT 2011

[root@X httpd]# tail -4 svn_logfile 
[02/Sep/2011:09:25:04 -0700] dgb rev-proplist r220
[02/Sep/2011:09:25:38 -0700] dgb change-rev-prop r220 svn:log
[02/Sep/2011:09:54:44 -0700] dgb log (/trunk) r220:220 revprops=(svn:author 
svn:date svn:log)
[02/Sep/2011:09:55:27 -0700] dgb change-rev-prop r220 svn:log   
<< svn is aware of the request

The propset command fails with or without the URL appended.  In the error_log 
there are indications of previous failures, but I no longer get those even when 
I remove the pre-revprop-change file.  I've tried svn propedit remotely and 
locally.  Remotely the command doesn't load the the current log message and 
fails.  Locally the command at least loads the current comment into the editor, 
but when I close the editor the update fails with the same error messages as it 
does remotely.

[root@X httpd]#svn --version
svn, version 1.6.13 (r1002816)
   compiled Oct  5 2010, 09:54:56

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : M

Re: svn propset svn:log wont work for me.

2011-09-02 Thread douglas barrett



 

 >> apache@X hooks]$ pwd
>> Y/hooks
>>
>> [apache@X hooks]$ ls -l pre-revprop-change
>> -rwxr-xr-x. 1 apache apache 2890 Sep  2 08:39
>> pre-revprop-change   << so I seem to have a valid hook
>>
>> [apache@irvine hooks]$ tail -14 pre-revprop-change
>> REPOS="$1"
>
>
>"tail" does not show the whole file. What happens if you try to run
>this script? ( ./pre-revprop-change )
>
>Do you have shebang line ( #!/bin/sh ) at the top of the file
>and does the shell mentioned there (/bin/sh or whatever) exist on your
>server and is usable by that user?
>
>Best regards,
>Konstantin Kolinko
>

Konstantin,

thank you for taking the time to respond.  You are right about tail of
course.  I used this command because my pre-revprop-change file was
created from pre-revprop-change.tmpl which begins with copious comments
which aren't germane.

The file does in fact contain the opening magic number and interpreter
path.

[apache@X hooks]$ head -1 pre-revprop-change
#!/bin/sh

{
   As a side point the "shebang" is not required for a shell script
   to run.
   
   [apache@X tmp]$ echo "echo \$*" > ./Echo
   [apache@X tmp]$ cat ./Echo
   echo $*
   [apache@X tmp]$ chmod u+x ./Echo
   [apache@X tmp]$ ./Echo "you don't need a magic number"
   you don't need a magic number
}

If I run the script it behaves as intended.

[apache@X hooks]$ ls /tmp/tmp
ls: cannot access /tmp/tmp: No such file or directory
[apache@X hooks]$ ./pre-revprop-change 
[apache@X hooks]$ ls /tmp/tmp
/tmp/tmp
[apache@X hooks]$ cat /tmp/tmp
running

So I still feel that there is a valid hook file and that somehow DAV
either doesn't like it (what's not to like it has the right name and
permissions) or some other prerequisite I am not aware of is missing.