Subversion Edge svnsync: DAV request failed & pre-revprop-change error

4.4k Views Asked by At

I've set up a Subversion Edge server on Windows as part of a migration exercise. Currently I'm struggling with svnsync.
When trying to execute the command (on the main server):

svnsync initialize https://main.subversion.server/svn/main.svn https://mirror.subversion.server/svn/main.svn --disable-locking --username=svnsync --password=SubversionEdge

it gives me the following 2 errors:

svnsync: E175002: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent  

and

svnsync: E175002: Repository has not been enabled to accept revision propchanges; ask the administrator to create a pre-revprop-change hook

I've tried several different pre-revprop-change hooks, but without any success, including "exit /b 1". I've also tried if it was a rights issue (changed user that the service uses to run and made sure that account had access to all the necessary files) Does anyone has any idea how to fix (or get around) this?

2

There are 2 best solutions below

0
On BEST ANSWER

It has to be exit 0, not exit 1, see SVNBook | pre-revprop-change hook reference:

The hook must actually exist and return a zero exit value before a revision property modification can happen.

For example, it's enough to put exit 0 to the target repository's pre-revprop-change-hook. However this way any authenticated and authorized user can change revision properties. That's not what you want, I guess.

You can implement some logic within the hook script to allow only 'svnsync' user to change revision properties:

IF "%3" == "svnsync" (goto :label1) else (echo "Only svnsync user can change revision properties" >&2 )

exit 1
goto :eof

:label1
exit 0
0
On

For windows, please use pre-revprop-change-hook.bat

And do check the if the account, for example 'svnsync' in your case, has the write permission to the target repo.