Should we not use subversion when frequent and large changes are made to source?
We have a LOT of xml files that we are checking into a subversion repository (let's say 30,000). We perform transformations on those files and this sometimes results in large differences. At this phase of development, we often see a complete re-write/re-structure of the xml. Later, chang开发者_JAVA技巧es will be subtle and we'll certainly want to benefit from all that a version control system offers; however, right now subversion is creating problems. Specifically, updating, merging, create massive conflicts, which are virtually impossible to resolve. Should we not be using subversion for managing this XML, right now? OR (hopefully) someone can recommend a better way of keeping all of the developers in-synch (we all need the XML) and eventually keep it properly versioned.
You should avoid placing automatically generated content under version control. Instead, integrate the generation of files into a Makefile that you run whenever the raw inputs change.
If you are working with a mixture of auto-gen and hand-editing, try to isolate the hand-edits into some kind of tweaks definition, which you then integrate into the automated build.
If all the above is impractical, the last resort is to tell Subversion that the files are binaries. This won't avoid merge conflicts, but it will prevent Subversion from mutilating the XML by trying to annotate the conflicts.
Having large differences between different revisions should be no problem in general. But if you are getting massive conflicts, there is something different going on. Perhaps you did not tell us the whole scenario completely. Conflicts can only arise when two people make changes simultanously to the same file. When one of those makes a restructuring of one file, while another one is working on it the same time, how do you expect to merge those changes anyhow?
To make it short, that is not a problem caused by using SVN. When you restructure something, do it on only one machine, and don't let anyone else work on the same file at that time in parallel.
AFAIK you can configure SVN for pessimistic (exclusive) locking of files, so it helps you to make sure there is only one person at a time making changes to the same file.
Store the data that is being represented in the XML files in a database. Then write a fairly simple program to transform that data into an XML document using LINQ to XML.
You could also save subsequent versions of the "XML" documents in different tables so you can archive previous versions.
精彩评论