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

Re: svn update or rsync - which is best to update live files

From: Blair Zajac <blair_at_orcaware.com>
Date: Fri, 25 Feb 2011 11:53:55 -0800

On 2/25/11 11:39 AM, Christopher D Haakinson wrote:
> Hi, I have subversion up and running quite well now(thanks to everyone here :-))
>
> Now I've come to the point in my development where I need to figure out what's
> the best method for transferring my svn files to my live site.
>
> I've read that I should use a post-commit hook, which is fine I'm using a
> pre-commit hook already so I'm aware of how they work.
>
> My main question is: Which method is best for updating my live files? Should I
> use rsync in my post hook or should I use svn update?
>
> http://subversion.apache.org/faq.html#website-auto-update this page recommends
> using svn update, but I wanted to get some input from the community too.
>
> Thanks in advance!

First, both svn and rsync do atomic replaces of the file, so you don't have to
worry about the live files being observed in some odd state.

There are tradeoffs.

- rsync will need to stat() each file in your working copy
- svn will only update the files that are newer; however
- svn currently requires a lock on each subdirectory

rsync will have two times the stat()'s, one for the source and one for the
destination.

Probably for speed, your best bet is to time either.

In 1.7, I would definitely use svn, as the locking issue goes away.

Blair
Received on 2011-02-25 20:54:30 CET

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.