Recursively overwriting Subversion directory files
So within my project tracked by subversion, I have a folder (let's call it /auto-generated/
) that is (as the name might suggest) automatically created from a GUI program (it's a bunch of xml files in a few nested directories). My project is designed to work in tandem with this GUI program, so I'd obviously like to keep any configurations from it in version control. It's already added and committed, so each directory has its own .svn/
folder already.
The problem comes each time I want to update the /auto-generated/
directory with all those new nested 开发者_如何学编程files. I can't just copy-paste the entire directory over from the GUI program's location, because then all the .svn/
folders would be over-written.
The lazy approach is to go into each folder side-by-side and manually just copy over the files for the base directory and every sub-directory therein. Obviously this is incredibly tedious.
Short of just writing a bash script to do this for me, is there any svn
command that I can use that won't completely break all the nested .svn/
directories in the already-tracked folder?
Normally, you shouldn't store generated files in your source code. However, sometimes that's not possible.
We had a similar issue with Robohelp generated Help files. Robohelp took Microsoft Word documents and generated HTML files. The problem is that all file and directory names would be changed every time we ran Robohelp. Normally, I'd just generate the damn files myself as part of the build process. However, we built on a Linux system, and Robohelp could only run on Windows (and only interactively).
We handled this by zipping up all files in Robohelp into one zipfile, and then just checking in that one zipfile. Our build process would unzip it when necessary.
You could do the same with your auto-generated files. Instead of an entire directory tree, you'll have a single zipfile to check in and out. When the autogenerated stuff changes, only one file (the zip) shows up in the history log instead of the entire directory tree.
Checking in derived artifacts is your problem - not subversion. You mentioned little of the project, other than it's a GUI that generates the files in question. is it possible to put auto-generated on svn:ignore and then have the build generate them? How long does it take your workstation to generate them? How often do they change?
精彩评论