1

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

1
  • 2
    Has your company ever considered the value of having actual processes that wouldn't make llamas sneeze in derision? Just asking. I got in trouble at one contract site when, on request and in accordance with written procedures, I overwrote the production version of something without checking to see if it had been specially modified. I've rarely been so happy to leave a place. Sep 21, 2010 at 16:16

4 Answers 4

5

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.
6
  • +1 because this does work (I had a similar problem). Wish I could +2 for the last step (I've been there).
    – JasCav
    Sep 21, 2010 at 16:09
  • 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 Sep 21, 2010 at 16:09
  • Can I do this repeatedly? 'curse at the dev that updated production while you fix all the conflicts.' Sep 21, 2010 at 16:13
  • 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. Sep 21, 2010 at 16:42
  • @Sander that can be taken care of when merging back into main repository, as all the current changes will be there
    – GSto
    Sep 21, 2010 at 20:24
0

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.

2
  • 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
    Sep 21, 2010 at 16:10
  • 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) Sep 21, 2010 at 16:14
0

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.

0

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.

1
  • I'm on a Linux machine via the command line, there is no folder to right click Sep 21, 2010 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.