我知道这个问题已经问过很多次了,但我相信我的情况是不同的。
我试图在SVN存储库中添加一个修改前更改挂钩,以使更改能够记录消息。
在添加pre-revprop-change
文件之前,我收到了以下错误:
$ svn propset -r 557 --revprop svn:log "New message!" https://myserver/repos/myrepo
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':
Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook
没问题,我想。我再加一句:
$ cd /var/www/svn/myrepo/hooks
$ # Create the simplest hook possible
$ echo '#!/bin/sh' > pre-revprop-change
$ echo 'exit 0' >> pre-revprop-change
$ # Check that it looks correct
$ cat pre-revprop-change
#!/bin/sh
exit 0
$ # Looks good, now make it executable
$ chmod a+x pre-revprop-change
$ # Check the permissions
$ ls -al pre-revprop-change
-rwxr-xr-x 1 apache apache 17 2012-05-24 12:05 pre-revprop-change
$ # Run it, to make sure it runs, and check the error code
$ ./pre-revprop-change
$ echo $?
0
所以,根据我所读到的所有东西但是,当我再次尝试编辑日志消息时,我仍然会得到一个错误(这次是一个不同的错误):
$ svn propset -r 557 --revprop svn:log "New message!" https://myserver/repos/myrepo
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.
有几点要注意:
1)存储库驻留在SELinux服务器(Fedora 10)上。也许在这些权限方面,我需要做些什么?下面是钩子的SE权限:
$ ls -alZ pre-revprop-change
-rwxr-xr-x apache apache unconfined_u:object_r:httpd_sys_content_rw_t:s0 pre-revprop-change
2)通过WebDAV访问存储库(请注意存储库名称中的https://
)。我是否需要在WebDAV端设置一些东西来允许修改前的更改?
发布于 2013-07-17 14:24:53
在CentOS上也有类似的情况。问题可能是缓存中的某个地方,因为当我编辑文件并将其更改回原来的时候,它就开始工作了。
因此,如果有人有类似的问题,只需尝试:
touch hooks/pre-revprop-change
https://stackoverflow.com/questions/10736505
复制相似问题