开发者

Subversion - how to carry out large scale changes to a project directory structure without manually using svn delete

开发者 https://www.devze.com 2023-02-13 22:27 出处:网络
This seems quite likely to have already been answered, but I\'m not sure how to phrase it! I have a large existing Subversion repository, corresponding to the project structure used by a particular I

This seems quite likely to have already been answered, but I'm not sure how to phrase it!

I have a large existing Subversion repository, corresponding to the project structure used by a particular IDE and containing various config files specific to that IDE. I want to migrate the project to a different IDE, while generally keeping individual source file history; this will mean, among other things, a few changes to the folder structure (the overall structure will remain the same), the deletion of config files, and the creation of new config files.

Example:

Old
---

Root
  -src
    -old_ide.xml
  -old_ide_folder
  -docs
  -old_ide.xml

New
---

Root
  -src
  -new_ide_folder
  -docs
  -new_ide.xml

I can see that I could make a fresh project elsewhere, and then diff it with the old project and make a series of individual changes in a SVN working copy until they match - that would give me the e开发者_如何转开发nd result I want, but be labour intensive.

The easiest way (technology allowing) as I can see it would be to simply delete the whole project, create a new project using the same source files, and then check that in/merge it somehow, but obviously the freshly started project won't be in a Subversion working copy and so I don't think I can do that.

I considered simply copying the new project straight over an old project working copy, which would probably work in that it would end up with a functional project in the new format, while also leaving me with various unused files from the old project still in the repository.

To be clear: the IDEs involved aren't really the issue, I reckon I could do this manually in the particular case, but I'm most interested in the general problem of carrying out a mass update to a Subversion folder structure.


I don't think there is a magical answer to this - it is just a matter of doing it. Tag or branch your existing layout before starting so you have an easy to find point of reference should you need to go back.

Otherwise, it should simply be a matter of checking out the existing project to a local working copy, and using the various SVN commands (copy, move, delete) to morph the layout into what you desire. I'm not sure why you want to avoid svn delete - that is exactly what you'd want for dealing with things like your IDE-specific config files. Once your workingcopy is the way you want it, commit.


For SVN clients <= 1.6: there seems to be no simple answer to this question . Probably the best approach would be to use a diff tool to simplify the manual work, or use a script which compares the working copy with your new structure and then carries out, file by file, whatever changes are needed to make the transformation.

For SVN clients >= 1.7: the change in working copy metadata storage (one top-level .svn folder instead of one per source folder) means that you could actually just delete the entire old structure, copy the new one into the working cop, and let SVN figure out the differences when you commit. I've not tested this, but I can't see why it wouldn't work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号