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

Re: Chained svns

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Wed, 24 Sep 2008 14:25:53 -0500

On Sep 24, 2008, at 06:50, John Doe wrote:

> From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
>> You can run a mirror of your Subversion repository at your datacenter
>> if you want. The tool is called svnsync.
>>
>> However it sounds like your real goal is to have a web site at your
>> data center, and the content of the web site comes from the
>> repository. In that case, you want what you don't want: you want to
>> "svn update" the web site at the data center when changes are made to
>> your development server.
>>
>> You're right that a potentially unstable network can cause problems
>> for "svn update". Unlike operations which write to the repository
>> (like "svn commit"), "svn update" is not atomic. So what we did at
>> the company where I worked was to "svn update" a working copy that
>> the web server didn't know about. When that was done, we used "svn
>> export" to create a new directory whose name was based on the tag
>> name (or you could use the revision number or the date if you're not
>> using tags). Finally, a symlink "current" was deleted and re-pointed
>> at the new export directory. And the web server only knew about the
>> symlink. In this way, you can easily and very quickly change your
>> live site from one version to the next -- and even go back to a
>> previous version if necessary (just put the symlink back to an older
>> export).
>>
>> There's a perl script that has been helpfully written to help with
>> these type of deployments. I haven't had a chance to use it, but
>> perhaps it will help you:
>>
>> http://search.cpan.org/search?query=SVN::Notify::Mirror
>
> Thx for your reply.
> The thing is that right now we have several websites and a rather
> "complex" file hierarchy composed of several svn repositories...
> Duplicating and playing with many symlinks might be a little too
> much in this context.
>
> But svnsync sounds good; why wouldn't it work for a website...?
> Can't I svnsync the repositories to our datacenter and then svn
> update localy from it?

Yes, you could do that.

Just remember that "svn update" is not an atomic operation. It could
fail in the middle somewhere for whatever reason, leaving your web
site's working copy in an inconsistent state. Even if it doesn't fail
anywhere, for the duration that the update is running, your working
copy is inconsistent. This is why I find it better to update a
working copy the web site doesn't know about, then repoint a symlink,
since changing a symlink is very quick, compared with the time it
takes to update a working copy. And repointing several symlinks will
still be very much faster than updating several working copies.

> Does snvsync handle updates as patches too?

Yes.

> Like, if I change 1 line in 500 1000000 lines files, will it
> transfer 500 one line diffs or the whole 500 files?

It will transfer just the diff.

As it was explained to me by Ben Collins-Sussman, svnsync effectively
checks out each revision from the source repository and commits it to
the destination repository.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-24 21:26:14 CEST

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.