I need to replace a directory in my SVN repository on the production server, but am not sure of the correct way to do this without breaking anything. The directory being replaced is a third-party module revision that has been completely restructured, so in order to upgrade cleanly I need to deleted the old directory/files and replace with the new directory and files. When I do this (using svn delete) the working copy becomes obstructed or in a state that prevents me from committing or adding the new, unversioned directory to the working copy. I've tried svn update, svn cleanup, as well as other UI (TortoiseSVN and Cornerstone) fix-it shortcuts, but can't seem to get things re-synced - that is without rolling back to a previous revision or checking out a new copy.
I believe that the target directory on both the local working copy and remote repo have to be deleted, the working copy updated, the new directory added to the working copy and then committed to the repo; but I am unsure of the specifics or any missing steps or subtleties that I may be missing. The module that I am upgrading is pretty vital to the site application, so I need to get this right the first time - as this is being made on the production server - and has to be done quickly. If someone could map the steps out clearly, I would really appreciate it.
To make this easier, you can do it in a way that creates a single "broken" revision where the directory doesn't exist.
svn up
to get your working copy up to datesvn delete <directory>
to get rid of the current directorysvn commit -m 'Deleted old module'
svn add <directory>
to add your new directory structuresvn commit -m 'Added new module'
This question has details about how to use "Vendor Branches", which may prove to be a better solution for your situation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With