Resource Fork Files, SVN and Versions App: A Cautionary Tale
Every now and again, you come across an unGoogleable problem. This particular one drove me nuts…
The Problem
I have a new SVN project on an Ubuntu box. I copy files from my Mac desktop to this project via AFP (dragging and dropping with the Ubuntu box mounted as a /Volume) and clean up any resource fork files (those beginning with ._ ) that I can see (I use TinkerTool for this)
Problem is, that I then drag across tiny_mce which has hundreds of the buggers nested deep within the file structure.
But I didn’t notice, and clicked the ‘Add’ button to the parent directories in Versions and then commit.
After the commit, I get a few error messages, including things like:
Can’t open file ‘/Path/To/MyDirectory/app/Plugin/Admin/Model/.svn/tmp/text-base/._AdminAppModel.php.svn-base’: No such file or directory
And now, I’m stuck. I can’t commit files, update anything, nothing works. So I try to checkout a new version to a different directory on the same Ubuntu box and get an error telling me I can’t.
The cause
So, I root around a little and work out that the repository has a copy of the resource fork files. All of them. The problem is that Versions hasn’t created a text-base version in the .svn directories. Any of them. But it has passed on the actual files and their contents, which leaves you in a right pickle.
The solution
I created a new project, exported my old content there, recreating where necessary and then (this is the important bit), I ran this command in Terminal
dot_clean -m /Volumes/path/to/my/new/working/copy/
Which recursively deletes all resource fork files – the -m deletes the files, rather than merge them. As I don’t need the files, I want them gone, but you may want them, so please read the dot_clean man page if you plan to do this.
Then, I add the files in Versions and commit – job’s a good’un
A better solution
A better solution would be for Versions to support resource files properly – either add the files to the repo and the text-base or don’t add them to either, don’t do one and not the other – madness.
Or, if you only have a few resource fork files that have borked up your SVN project, you may want to use a different SVN GUI app, or command line, and delete (SVN delete, not Mac delete) the files, then return to Versions after this
Filed under: Apple Mac,SVN,Versions - @ August 8, 2012 5:10 pm