Sam's notebook

Switching an SVN directory to and from an 'externals' definition December 28th, 2011, 7AM

Programming

There seems to be quite a few posts out there about how to replace Subversion externals definitions with local directories, but not so much for going the other way. I’m not sure why; it seems to me more likely that one would start off with some small module as part of a bigger repository, and then at a later date want to move it out to live on its own. I don’t really know what I’m on about, though.

The point being, that I’m working with a branch of a project that is having a few of its directories — its current, local, ‘normal’ directories — replaced by externals definitions. That’s all fine and good, but I keep having to switch to trunk and back again, and there’s the crux: the directories that are getting turned into externals do not like being switched.

Running the usual svn sw http://svn.example.com/repo/branches/v2 from the top level of a trunk checkout gives the following error:

Fetching external item into 'lib/foo':
svn: warning: W155037: Previous operation has not finished; run 'cleanup' if it was interrupted

Running svn cleanup complains with:

svn: E155010: The node '/path-to-repo/lib/foo/file.txt' is not installable

And not even status has anything useful to say (throwing instead the same error as above).

A solution (and yes, this post is probably a bit long-winded for such a short snippet of advice; I can only say that I felt like writing this down this morning because four weeks ago I figured it out but forgot and I suspect that four weeks hence I’ll have forgotten again, and this morning is one of those moments of verbosity; blame Travels with Charley, which I was reading over breakfast this morning), and it’s probably not the ‘proper’ solution because I’m no Subversion hacker and do rather treat it as magic, but the solution that I use is (and I’d better put it on it’s own line, because no one’s likely to have read to the end of this paragraph)…

Delete the offending directory (as in, rm -r lib/foo or what have you), and update again.

That’s all.

[4 comments] [Keywords: , , , , ] [Permanent link]

4 comments

  1. Wesley Song says:

    LOL, deleting the folder and update again seems awkward, but that works fine… Thanks for your journal!

  2. Sam Wilson says:

    Yeah, it is awkward, and feels like a bit of a hack; but maybe not. :-)

  3. Thanks for the excessive explanation. The solution worked like a charm!

  4. Gordon says:

    Thanks for blogging this, saved me some pain.

    +1 for referencing Travels with Charlie :)

Leave a Reply

Your email address will not be published. Required fields are marked *