You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Nathaniel Case <nc...@xes-inc.com> on 2005/06/01 19:45:46 UTC

Shadow/Mirror hook script

I noticed that a few people have asked about a feature that would 
automatically mirror the latest version of a repository to a 'shadow' copy.

I also needed this, so I wrote a post-commit hook script to do it 
(attached).  It works by using svnlook to determine what has changed, 
and then implements those changes (modify, add, delete) to the target 
shadow directory.

The first time the script is ran, it will do a full export to the target 
directory.  Subsequent runs should do the incremental changes.  It's 
smart enough to track the last version it sync'd with, so it will sync 
with all versions it hasn't sync'd with yet in the history (though this 
shouldn't be necessary assuming it runs successfully on each commit).

This should be nicer than other alternatives for many use cases, since 
you don't have to do a full export each time, and you also don't 
unnecessarily have the .svn directories in the shadow directory.

It hasn't been heavily tested however, so I would appreciate any 
feedback.  See the comments at the top of the script for example usage.

- Nate Case <nc...@xes-inc.com>

Re: Shadow/Mirror hook script

Posted by allan juul <al...@muly.dk>.
Nathaniel Case wrote:

> I noticed that a few people have asked about a feature that would 
> automatically mirror the latest version of a repository to a 'shadow' copy.
> 
> I also needed this, so I wrote a post-commit hook script to do it 
> (attached).  It works by using svnlook to determine what has changed, 
> and then implements those changes (modify, add, delete) to the target 
> shadow directory.
> 
> The first time the script is ran, it will do a full export to the target 
> directory.  Subsequent runs should do the incremental changes.  It's 
> smart enough to track the last version it sync'd with, so it will sync 
> with all versions it hasn't sync'd with yet in the history (though this 
> shouldn't be necessary assuming it runs successfully on each commit).
> 
> This should be nicer than other alternatives for many use cases, since 
> you don't have to do a full export each time, and you also don't 
> unnecessarily have the .svn directories in the shadow directory.
> 
> It hasn't been heavily tested however, so I would appreciate any 
> feedback.  See the comments at the top of the script for example usage.
> 
> - Nate Case <nc...@xes-inc.com>
> 

looks neat !
havent tried yet -so just out of curiousity, what happens if multiple 
people commit multiple files simultaneously ?

./allan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org