This is sad to admit, but I am fairly new to Subversion. I implemented my first code repository like three weeks ago. So far I am loving it. It's really awesome to able to actually delete code rather than commenting it our or making ".BAK" files. Finally, a way to both clean and backup my code base as the same time.
As much as it has been easy to implement, I did run into a snag yesterday. I had just made some major changes to my application, including directory renames and dozens of file updates; when I went to commit the changes, it looks like everything was processing smoothly, and then suddenly TortoiseSVN told me that the commit failed at the very end. I tried to run the Commit again and it said that it could not work - it told me to run a Clean Up command. So I did that. But then, it told me:
Subversion: Cleanup Failed To Process The Following Paths
I tried to clean different directories, but none of them worked. To make things even more confusing, I took a look at the repository using the Repo Browser and it appeared that all the updated code had been, in fact, committed properly. What the heck was going on?!?
After a little Googling, it looks like sometimes Subversions commits actually work, but fail to unlock the code tree (or something) .... and there's not much you can do about it. From what I read, this is a known bug in Subversion. Unless someone has a better suggestion here is how I fixed my WWW code base:
This was frustrating because it took a while to checkout the entire code base to the "www_temp" folder; but, it seems to have done the trick. I am gonna keep my "www_failed_commit" around for a while to make sure all the code it there, but it appears that the transfer worked properly.
Aside from this, I am really loving Subversion. I finally see what all the hype is about :) I hope that this might help some people out.
Comments (24) | Post Comment | Ask Ben | Permalink | Print Page
OOPhoto - Creating Idealized Business Objects
Flex Authority: Issue One - A Truly Polished Publication
Ben,
I had to laugh when I saw the title of your post because I just finished a post myself describing a problem I had with Subversion. After I post I always check MXNA to see if my post shows up and there it was, immediately above your post. Of course my problem wasn't a bug, it was just my stupidity, but still, it was a funny coincidence.
Cheers,
Posted by Bob Silverberg on Aug 20, 2008 at 10:54 AM
@Bob,
I had the same thing - I have your post open in another tab and will read it after my conference call :)
Posted by Ben Nadel on Aug 20, 2008 at 10:59 AM
I don't like SVN... whilst it is definitely an improvement over CVS, it's too quirky and SLOW.
For anyone not tied to SVN, I'd recommend switching to either Git ( git.or.cz ) or Bazaar ( bazaar-vcs.org ).
Posted by Peter Boughton on Aug 20, 2008 at 1:01 PM
@Peter,
I have heard of Git. I don't find SVN to be too slow. I only commit like once or twice a day depending on what I am doing, so it's been OK. We are using a hosting SVN service, so doing it over HTTPS makes it noticeably slower, but still, I am OK with it so far.
I will definitely look into Git though.
Posted by Ben Nadel on Aug 20, 2008 at 1:07 PM
@Peter: I too have heard of Git, but not investigated at all. Does it have integration into Eclipse similar to SVN? Does it have a decent Windows GUI?
Posted by Bob Silverberg on Aug 20, 2008 at 1:45 PM
>> Does it have a decent Windows GUI? <<
There is an integrated Cygwin-Git package that will run on Windows, and from within that you can invoke a GUI repository viewer (gitk), plus a commit staging area thing (git-gui) - the latter of which you can also create a edsktop shortcut to, so you don't even need to go into the Cygwin terminal.
>> Does it have integration into Eclipse similar to SVN? <<
There is a project named Egit which does Eclipse integration, but I've not yet tried that.
There's also git-svn which is some sort of bridge between Git and SVN - I'm not certain but I think that may allow you to use SVN tools with Git.
Posted by Peter Boughton on Aug 20, 2008 at 2:13 PM
@Ben,
Do you mind sharing which hosted Subversion service you are using?
Posted by macbuoy on Aug 20, 2008 at 4:46 PM
@Ben,
Actually, can you tell us more about why you decided to go with a hosted solution rather than managing the Subversion Server yourself on your own machine?
Posted by macbuoy on Aug 20, 2008 at 4:47 PM
@macbuoy - the good thing about a hosted service is that you never need to worry about installation or maintenance or security patches etc. That's the job of the service!
The other thing is of course piece of mind. If your machine dies you know your code is nice and safe in a fully redundant environment which you can access from other machines.
That is of course another thing (for Bens environment). If he ever does distributed development, how will remote developers access his svn server? Of course it could be setup without too much pain, but just something else to worry about.
For me there are pleny of paid and free svn providers out there to use.
Posted by Michael Sharman on Aug 20, 2008 at 5:10 PM
Before you get too far with Subversion, you'd do well to give Bazaar a try. Command-for-command, it's very similar to Subversion for most of the basics, and if you're into GUIs, TortoiseBZR is functional, though perhaps not as refined as TortoiseSVN.
I found that despite knowing the value of using source control, the overhead of setting up and maintaining access to Subversion repositories made it unattractive. Too many times I'd say, "I wish I'd been tracking this."
Not so with Bazaar. It fulfills the maxim "simple things simple and hard things possible" much better than Subversion. I love that I can start tracking files anywhere anytime without having to involve some outside server in the process. And I love the fact that if I do need to sync to some third party, that's all built-in, dirt simple, and flexible.
I'm not sure what to recommend with regard to hosting Bazaar repositories. The obvious choice, Launchpad.net, is (as I understand) only for open source projects. But you can host a Bazaar repository anywhere that's running sshd.
Give it a try; I'm sure you won't regret it!
Posted by Steven N. Severinghaus on Aug 20, 2008 at 5:22 PM
@Macbuoy,
Micheal hit it right on the head. For us, it was two things: backups and distributed development. We decided to go with CVSDude.com. Apparently they do backups many times through out the day. I can also create users and assign them different rights to different repositories. The whole things was really easy to set up.
Code is our product; if something were to go wrong, then we are screwed. As such, we didn't want the overhead of getting that process 100% perfect. We'd rather have experts handle it for us so that we can concentrate on writing the code.
So far, I am really pleased with their service.
Posted by Ben Nadel on Aug 20, 2008 at 6:16 PM
@Ben,
You may want to consider doing commits more frequently than twice a day IMO. I will make commits at key points that I can go back from if need be just so that there is a version in the repo.
Just a thought!
Posted by Hatem Jaber on Aug 20, 2008 at 7:38 PM
@Hatem,
I find that I do a commit when I have completed a "thought". Meaning, if I wanted to update the way something works, it might involve 10 different files. I don't commit until I have updated and tested those 10 files. But, I have no problems committing more than that.
Posted by Ben Nadel on Aug 20, 2008 at 8:06 PM
Git is the New Hotness is some circles (like amongst Rubyists). It was originally designed by Linus Torvalds as the tool to manage the Linux kernel sources, so it's very much optimized for widely-spread, totally decentralized development. There's no central server, just lots of people with their copies of the source, swapping patches back and forth. This also means that it has lots of tools for handling branching, and N-way merging.
That may or may not be what you're looking for. What Git is good at, Subversion basically can't touch. But if you actually want a central authority, or a more traditional workflow, Subversion may be a better fit. Git can simulate some of those modes, but that's not really what it's FOR. I also find it conceptually much more difficult, but that could easily be a matter of relative unfamiliarity.
Posted by Sixten on Aug 20, 2008 at 11:43 PM
I had the same problem.
I deleted my local directory where the files were (after backing them up), and then did an update.
Problem fixed.
Posted by David Buhler on Aug 21, 2008 at 10:34 AM
I need some sort of Subversion/GIT for dummies book. My designer mind has a hard time seeing the big picture or birds eye view of how a versioning system works. I'm behind the times and am tired of FTP'ing to a dev server and copying changes to a prod server. :-(
Posted by jyoseph on Aug 30, 2008 at 12:58 AM
@jyoseph,
I dont' have anything in the way of a recommendation. I am relatively new to this stuff myself. Good luck!
Posted by Ben Nadel on Sep 1, 2008 at 8:38 AM
Gah, sorry I'm late to the party on this post.
Those looking for a solid introduction to SVN would do well to read this (online) book:
http://svnbook.red-bean.com/en/1.4/svn.basic.html
(I've linked the "so you're new to SVN" chapter, but the whole thing's there)
I've found this book to be an exceptional piece of documentation.
Posted by Jono on Sep 2, 2008 at 3:09 AM
@Jono,
I have to admit that I found that book a bit confusing. The order of the chapters felt very weird. I don't remember exactly, but I feel like the basics where towards the end and the beginning lacked explanation. Maybe it was just a bit over my head.
Posted by Ben Nadel on Sep 2, 2008 at 8:23 AM
@Jono thanks for the link. I did check that book out a few months back and had a little bit of a tough time with it. I thought to myself, this would be a lot easier if I had a friend or coworker who fully understood it to point me in the right direction. One of those things I think if you see someone do it it's easier to understand.
Not possible in this case but wishful thinking. I will go back in and maybe skip a bit further down in the book, maybe once I get over the hump it'll be easier (or maybe I'm making it out to be more difficult that it really is).
Posted by jyoseph on Sep 2, 2008 at 10:48 AM
Thanks this post saved my ass today, SVN was almost driving me crazy with this stupid error.
It's pretty lame though that I had to delete my old dir and create a new one. I don't like SVN at all too, but hey, it's free, has a nice windows GUI (Tortoise) and can be hosted on Linux servers (free too).
If you want something more reliable or at least with a company you can blame and complain for, spend some extra hundred bucks from your budget and get Microsoft's Source Safe (or similar, I don't know how they call this now). :)
Posted by Bruce on Sep 17, 2008 at 4:50 PM
@Bruce,
Glad this could help :) Yeah, it is lame that you have to create a totally new folder and do all the refreshing... but like you said, its Free and it works pretty well like 95% of the time.
Posted by Ben Nadel on Sep 17, 2008 at 5:03 PM
Same problem here, but I really (REALLY) didn't feel like checking out the original repository and copying over. So here is the very hacky solution: go search for "lock" files in the .svn directories (these are 0 length files that supposedly lock the directory). After deleting these files by hand I was able to do a normal update.
Disclaimer: I only did this because I hadn't worked on the project in a while and knew that I wouldn't lose code. If worst came to worst I could just do a clean checkout. Don't try this solution with critical code :-) Or at least back up any changes you made before doing so. Also, the first thing to try should be the cleanup command. Only if that fails, go and try the brute-force approach.
Posted by Lazerman on Oct 6, 2008 at 4:56 PM
@Lazerman,
It's funny you mention that. I actually tried that using FlexRename:
http://www.bennadel.com/index.cfm?dax=blog:460.view
After I deleted all the lock files, I tried to run cleanup again, and it broke in the same way. Maybe my problem was that I tried to run the cleanup again :)
Posted by Ben Nadel on Oct 6, 2008 at 6:10 PM