On Aug 9, 2019, at 13:45, Ron T wrote:

> Hi, What is the recommended method to keep an svn mirror in sync each time a 
> user commits? I have about 20 users posting commits throughout the day and I 
> would like to have the svn mirror duplicate or copy the current commit from 
> the source repo. I've tried putting this line in the source repo post-commit 
> file.
> svnsync sync file:///mnt/svn_mirror/ where svn_mirror is the target repo but 
> end up getting this error.
> 
> svnsync sync file:///mnt/svn_mirror/
> Transmitting file data .....svnsync: E160004: Corrupt representation '366133 
> 106082 55 1620 4bd1fbfd9712b0660edfb5f56e9ef672'
> svnsync: E160004: Malformed representation header

That would have been my suggestion. I'm not sure why it doesn't work. I'm sure 
someone else will chime in with suggestions for diagnosing that. What kind of 
file system is this?

In the mean time, though, as a workaround, you could try delaying for a few 
seconds before running svnsync.

Remember also that the user's svn command does not return a successful result 
until after your post-commit hook finishes running. The user doesn't really 
need to be around for the svnsync operation, so you could spawn the sync off 
into a background task using "&". There are a couple things to keep in mind 
with that: You need to redirect the stdin, stdout and stderr of that 
spawned-off background task to /dev/null, otherwise the post-commit won't end 
until the spawned task does. And you'll want the spawned task to be a wrapper 
script around svnsync that somehow ensures (with some kind of lock?) that only 
one copy of the script is running at a time.

Reply via email to