views:

34

answers:

2

I have set up a SVN repository on a development that contains a website. The website files were imported using the svn importa few days ago.

I also have the same website in an un-versioned state on the same server which is a mirror or the site on our live production server. This is in-case our live server crashes we can quickly reupload all the sites via FTP. The mirroring is handled by rsync and is working perfectly.

My colleagues are not currently using SVN yet because it's a new process and they have not yet been trained. They still FTP files down, edit locally and re-upload. Hence the need for SVN.

I need to keep my repository version of the site up to date with the live production version while we change over as they are still using FTP and have probably made changes since I imported the site a few days ago.

What I need to know is how can I perform a sort of re-import into the repository of just files that have changed from my mirrored un-versioned copy. I don't want to drop the repository and create new one and import because I would like to keep the current version history. So I what I hope to achieve is that any files that have changed would be imported as a new revision.

What I have tried

I tried creating a working copy of the site as it is in the repository. Then using rsync between the working copy and the un-versioned mirror copy. The only problem is that all the .svn/ folders a deleted from the working copy as they don't existing in the mirror (un-versioned) version.

Is there a way to get rsync to preserve the .svn/directories on the working copy even though they don't existing on the source site?

Or is there a better way to update any changed files into the repository?

+2  A: 

Can't you just copy the changed source tree over a working copy, and then commit it?

Also, you can pass --exclude ".svn" to rsync. Read about rsync exclusion here.

There's also the --cvs-exclude parameter in rsync, but you'd have to check if your version of rsync supports svn with it, as the patch is quite new.

Kornel Kisielewicz
Yes I could but the site is quite large and I only really want to update changed files.
Camsoft
@Camsoft -- exclude is a better alternative to delete :)
Kornel Kisielewicz
+1  A: 

rsync -azcC --exclude=.svn /path/to/unversioned/source/ /path/to/working/copy/

prodigitalson