Wednesday, October 19, 2011

Gotcha of the day: Emacs SVN support breaks with SVN 1.7

Early tonight, I upgraded my Cygwin install, which gave me access to SVN 1.7. No biggie, right? I went to run my usually set of SVN commands, and got a warning about how I needed to run svn upgrade before I could continue.

Nervous, but yet determined to move forward with the latest set of tools, I ran svn upgrade on one of my source trees. Nothing particularly exotic happened. As I had hoped, svn continued to function as normally.

That is, until I typed svn-status in emacs. At which point, emacs loudly complained: foo is not Subversion controlled (missing .svn directory). Run dired instead?. D'oh!

Apparently, Subversion 1.7 does away with the convention of storing metadata in individual .svn directories. This is probably a good thing, though by now I'm so used to this, I can't really say I'm glad they made this call. All I know is that psvn.el, one of the standard svn modes is now broken. Life without functioning Subversion inside of emacs is miserable indeed.

At first I tried to remove the various checks for .svn directories in the psvn.el source code. But I quickly got over my head. For plan B, I decided I would try an alternate emacs mode: dsvn. Fortunately, dsvn.el doesn't depend on .svn directories, and so it handled the new layout just fine.

For the most part, dsvn appears to be a drop in replacement for psvn -- though the *-* (select all modified) command I was used to running doesn't appear to exist. Still, I should be able to add that in if I really need to.

Bottom line: I've got emacs and Subversion 1.7 back to playing nice. Crisis averted. Whew.

10 comments:

  1. You might want to try magit/magit-svn. I now use that for all my repositories. You have most of the advantages of git even for svn repositories.

    ReplyDelete
  2. Thanks very much for the hint with dsvn.el, this solves half of my problems. I used psvn for the directory-level things, but I really like vc-svn.el for the in-buffer manipulations. But I do not seem to be able to get my fingers on a 1.7-enabled vc-svn.el. Did you/anyone have success on this front?

    ReplyDelete
  3. Damien - thanks for the heads up on magit/magit-svn -- I'll have to check it out.

    ReplyDelete
  4. Michael -

    I haven't found a solution for vc-svn.el yet. But, I'm in the same boat you are - I found myself switching between the two pretty regularly and I'm going to be hurting if I don't find a fix for not having vc-svn.el.

    ReplyDelete
  5. Anonymous6:05 AM

    You can use the trunk vc-svn.el instead:
    http://bzr.savannah.gnu.org/lh/emacs/trunk/files/head:/lisp/vc/

    ReplyDelete
  6. I was also hit by the new svn client. Googling for solution, I found this fix:

    http://www.eaflux.com/

    I haven't tested it thoroughly, but tried svn-status in a subdirectory and it worked.

    ReplyDelete
  7. Had the problem... upgraded TortoiseSVN and had issues. Found this www.eaflux.com fixed it perfect.

    Thanks!

    ReplyDelete
  8. In case you haven't seen it by now, there's a fix for vc-svn. It's at the wiki: http://www.emacswiki.org/emacs/SubVersion#toc4 It's working for me so far.

    This is also supposed to be fixed in Emacs 24. Thanks for writing this up. It got me pointed in the right direction.

    ReplyDelete
  9. Mike - that totally works, thanks!

    What a relief it is to be able to hit C+x v = and have a diff pop-up. You never realize how frequently you do this until you can't do it any more.

    Next, I really should grab emacs 24 and start getting used to it.

    ReplyDelete