tags:

views:

65

answers:

4

So I have a Subversion Repo /project which was last updated 2 months ago. Some changes where made on the production site (Yeah not my idea, one of the other dev's) and now I need to add those changes into the subversion repo.

So I've zipped up the production files/directories and copied them onto my local dev box, also checkout the latest copy of the repo on my dev box as well. There are a number of new files/directories as well as some changes in some of the current files.

What would be the best approach to adding these changes into subversion? Is it as easy as copying the new files from the zip into the local repo project and committing that way? (I did this and I don't see all of the changes).

Any thoughts?

NOTE: I'm using the command line svn no GUI

EDIT:

Yeah no large structural changes, just added some libraries (directories) and added some need functionality into the existing scripts

+3  A: 

Here's what I would do:

  • Create a new branch of the project
  • Get a checkout of the branch on your dev box
  • Add the files from production to the branch checkout.
  • add/commit the production files
  • merge the branch into the repository
  • curse at the dev that updated production while you fix all the conflicts.
GSto
+1 because this does work (I had a similar problem). Wish I could +2 for the last step (I've been there).
JasCav
Thats what I tried to do 'cp -R /zip/* /checkout/project' but when I do a svn status I don't see all the new files that need to be added
Phill Pafford
Can I do this repeatedly? 'curse at the dev that updated production while you fix all the conflicts.'
Phill Pafford
Re #6: Only curse?
David Thornley
This will only work when you create a branch that starts at the revision that exists on the production server, otherwise you're bound to make undo changes that happened in later revisions.
Sander Rijken
@Sander that can be taken care of when merging back into main repository, as all the current changes will be there
GSto
@GSto, they will indeed show up as changes, but it makes it harder to see the changes that happened on the production server, because you'll also see the changes that happened in the repository in the mean time
Sander Rijken
A: 

Copy the new files and folders into your project. Add them using your favourite subversion client.

Use a merge tool to compare all production files with your working copy. winmerge is a great tool for this and then merge over the parts you want.

Commit your changes.

skyfoot
Depending on how complicated the changes, this could also work, too. Typically as long as you didn't make large structural changes, you can do this.
JasCav
I'm using the command line on a Linux box. Also the current files have only added code, nothing is modified in the old code (Just added new functionality)
Phill Pafford
A: 

The best way would be to update your working copy to the revision that exists on the production server, then move the existing files from the production server into that working copy, if you now update the working copy (with changed files) subversion will merge changes after that revision to HEAD.

This will probably give you some conflicts though, depending on how much has changed.

Sander Rijken
A: 

I would right-click on your folder and the SVN menu will give you an option to check for modifications. You can see what has been changed and just revert to what is in the repository or merge changes you may have made.

Chives
I'm on a Linux machine via the command line, there is no folder to right click
Phill Pafford