views:

409

answers:

3

We manage our web development using SVN. On one project, we deployed the site by Exporting the project and FTPing it to the client sever. This client is hands on and has made changes to the code on the FTP. We're hired to add more functionality to the site now.

How can I take the work that's been done on the FTP and merge it into my working copy? I'd like to preserve svn props and externals and only update those files that were changed, so that I can track those changes using diff. Thanks!

+3  A: 

Copy the folder into your local working copy, and let it overwrite any changed file. You now have a working copy with all the changes, that you can normally commit. Update 1: Any unchanged file will be detected as such, so won't be committed (at least using tortoise)

eglasius
You would also want to check for new unversioned files, so check for unversioned files before and after the copy, and check in the new ones
Sander Rijken
Do you know of a good command line method of copying files over without replacing the whole directories? I don't want to destroy all the .svn folders. Just move the files. Thanks so much!
weotch
what environment are you on? / on windows I would just copy it from the normal file explorer and it will only add folders/file and replace files, so the .svn folders would still be there.
eglasius
Mac. If I drag a folder onto another, that folder is replaced in it's entirety.
weotch
I mean, given the ftp copy is a deploy without the .svn folders. If it does have the .svn folders, do an export to get it without the .svn folders.
eglasius
dunno about mac :(
eglasius
Here's my solution, FYI: rsync -avz source/ destination/ --exclude=.svn
weotch
+1  A: 

First, make sure you don't have uncommitted changes on you local copy. If you do and they are stable, commit them. If you have unstable changes, you better create a fresh checkout from the head revision. Then follow the next steps.

  1. Create a Tag/Branch of your current head revision.
  2. Update your local copy to the head revision. (see comments above)
  3. Download the code from the FTP
  4. Copy the downloaded code into your local working copy
  5. Check for the files that changed after the overwrite.
  6. Marge those changed files using a diff tool.
  7. Commit the merged files.
  8. If something goes wrong, you can rollback to the tag/branch you created on step 1 and try again.
Chepech
A: 

Maybe a bit off-topic, but how about trying a distributed version control system like git, bazaar or mercurial? Sounds exactly like what you need.

The client can clone a repo and make commits to it locally, then you can merge it back to the master repo when you're done. This way you still retain all the history from the client, whereas FTP will not.

jay_soo