Re: Recommended method to keep an svn mirror in sync per commit?
From: Ryan Schmidt <subversion-2019_at_ryandesign.com>
Date: Sat, 10 Aug 2019 14:57:51 -0500
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.
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.
|
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.