Thursday, September 17, 2009

Subversion – Odd Problems and Funny Solutions

I've been using Subversion and TortoiseSVN since 2005.  They're both great technologies and I'm very happy they exist.  However, I think anyone who's been using them for a while has periodically encountered some weird problems and has had to come up with a few strange (and even funny) solutions.  I certainly have.  In this post, I describe one example.

Earlier this week, a developer I work with saw the following in a TortoiseSVN window when he ran update on a working copy:

Error: Couldn't do property merge 
Error: Unable to make name for 'C:\tempfile'

Not knowing how to proceed, he asked me for help.  We tried my typical first approach: running cleanup via Tortoise on the working copy.  That didn't fix it, so we ran a "Check for modifications" and discovered that there were a few temp files scattered through the directory tree.  We deleted those and tried again.  Still the same message, so on to Google.  I searched for various permutations of the error messages, but was unable to find anything other than code check-in comments for Subversion itself, which appropriately enough uses a Subversion repository.  For some reason, I wish I remember why, we next tried updating just one child directory within the working copy.  It worked!  We tried updating all the other child directories and those worked as well.  So, that suggested that there was something wrong with the Subversion metadata, but only at the top level.  We went into the .svn directory and started browsing through the files.  When we looked at the entries file, we noticed a few lines starting with "incomplete".  I tried moving the entries file out of the .svn directory to a totally different location in the file system, hoping that when we updated or ran another cleanup, the file would simply be recreated.  Unfortunately, with that file missing, the directory was no longer considered by Subversion to be a working copy.  Disappointed, I moved the entries file back into .svn and started thinking about what to do next.  On a whim, the guy I was helping tried updating again and it worked!  Somehow, changing the directory from a valid working copy to an invalid one and back again was enough to fix everything.  Who knew?!

Have any good Subversion/TortoiseSVN troubleshooting stories or troubleshooting tips of your own?  Please leave them in the comments.

3 comments:

  1. I have had annoying cases happen like that as well. What I do is export all of my changes to a temporary directory, blow away the working copy directory, re-import it and apply the changes I had set aside. It sucks, but it works.

    ReplyDelete
  2. I had this problem as well. To fix it for me I had to give my user full control of the parent folder of directory I wanted to update. Which I imagine was the case for you too, since by default users can't create files on C:\ on vista and beyond.

    ReplyDelete
  3. Hmm. That's interesting. We never explicitly changed the permissions for the files or directories, but it's possible that moving the file out and then back in caused a change as a side effect. I'll have to read up on that sometime.

    ReplyDelete