I've been looking at the code to upgrade from .svn/text-base to .svn/pristine. There are two ways to invoke it:
- For a 1.6 wc the user must execute an explicit "svn upgrade". Any outstanding log files must first be cleared using a 1.6 client. - For a 1.7 wc the upgrade is automatical for most operations. At present this happens when the wcroot object is created. It doesn't run any outstanding workqueues, but if outstanding workqueues interrupt the operation the wc is only partially upgraded. The current text-base upgrade code involves no database schema change beyond the user_version number. It excutes as a single transaction per directory. It calculates the checksum of each text-base, adds a row to the PRISTINE table and copies the file into the new location. Both db operations and file IO occur during the transaction. There are a few issues: - I think upgrading with outstanding workqueue items is wrong. If there are items that will modify the text-base then the upgrade will install the wrong pristine with the wrong checksum and the change will get applied to an obsolete file and be lost. - From a performance point of view it would be better to move, rather than copy, the text-base. - We have to allow the upgrade to be interrupted and restarted. This works if we copy the text-base, but if we move instead we have to track the moves. To fix these I think the basic upgrade operation should be changed to the following: first create workqueue items to move the text-base files. Then, in one transaction, add all the rows to the PRISTINE table and install the workqueue items. Finally run the workqueue. Then the automatic upgrade process for 1.7 working copies should be changed so that it only runs if the workqueues are empty. If there are outstanding workqueues the user is forced to run "svn cleanup". -- Philip