pre-commit hook to block the commit other than svnsync

satheesh
satheesh
Hi,    I need Maintain mirror database for users(read-only purpose). so i need to block the commits in pre-commit. I need to write pre-commit hook to block the commits other than the svnsync.    How can i block ?      Thanks...

Last updated

philip
philip
The standard, documented, way is to allocate a repository username/password that is used when invoking svnsync and is not used for anything else, then use the start-commit to check the username. However that doesn't prevent commits using the username/password by clients other than svnsync. It's up to you not to use the username/password for anything other than svnsync.    In the pre-commit you could check for the presence of the r0 revision property svn:sync-lock, that indicates that svnsync was started and has not yet removed the lock. However that doesn't prevent other commits while svnsync is running or if svnsync died and failed to removed the property.
andyl
andyl
You have 2 options:
  • Set up user access controls and only grant the svnsync account write permission
  • Configure your mirror as a write-through proxy so that all of the commits are passed up to the master
   But I suspect, based upon your previous questions, that you do not have things in your environment set up to properly support the latter.

1-3 of 3

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.