[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svnsync and the hooks scripts

From: Grégoire Welraeds <gregoire.welraeds_at_side-international.com>
Date: 2007-11-09 12:21:01 CET

Hello,

I’m setting up a repository mirror with svnsync and I’m a bit worried
about the revision properties which can change at any time. To have a
perfect mirror, the only way is to call svnsync from post-commit hook
and pre-revprop-change hook.

Starting "svnsync sync" to synchornize a mirror once every x time from a
script (eg: called with crontab) will most probably miss some revprop
changes. And if "svnsync copy-revprops" is called from the
pre-revprop-change hook, then there is no other choice but to call
"svnsync sync" post-commit hook. Otherwise you put your mirror at risk.
For instance:
1. svnsync sync is called from a script once every hour, svnsync
copy-revprops is called from the pre-revprop-change hook:
- svnsync sync is called. Mirror is updated to rev x, one hour of delay.
During that time:
- commit in master of rev x+1
- revprop change to modify svn:log in master for rev x+1
- svnsync copy-revprops called for rev x+1
=> x+1 is not yet commited in the mirror.
2. svnsync copy-revprops is not called from pre-revprop-change
- svnsync sync is called from the hourly script. Mirror is updated to
rev x. One hour of delay.
During that time:
- commit in master of rev x+1
- revprop change to modify svn:log in master for rev x+1
- revprop change to modify svn:log in master for rev x-5
- svnsync sync is called from the hourly script again. Mirror is updated
to rev x+1
=> revprop change for rev x+1 will be populated correctly, not the
revprop change for rev x-5

I though I would share with you my opinion that the only efficient way
to synchronize a mirrored repository is to call "svnsync sync" and
"svnsync copy-revprops" from respectively post-commit hook and
pre-revprop-change hook. Although it might obvious, it is not clearly
stated in the documentation I have read on svnsync.

Your comments are appreciated.
Grégoire.

------------------------------------------------------------------
CONFIDENTIALITY: This e-mail and any files transmitted with it are confidential and intended solely for the use of the recipient(s) only. Any review, retransmission, dissemination or other use of, or taking any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you have received this e-mail in error please notify the sender immediately and destroy the material whether stored on a computer or otherwise.

DISCLAIMER: Any views or opinions presented within this e-mail are solely those of the author and do not necessarily represent those of SIDE International S.A. - EastNets Group, unless otherwise specifically stated.
------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Nov 9 12:21:34 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.