Removing CVS directories from Subversion

It’s time for a cleanout. A couple of servers here have Drupal 7 installed from CVS. As CVS is no longer used by Drupal, it’s time to clean those unneeded directories out of SVN with a mass SVN delete command

svn delete `find . -type d | grep 'CVS$'`

The command in the backticks finds everything of type directory, and then it’s passed (piped) to grep which filters the results. The $ at the end of the CVS tells us to only show root CVS directories, nothing inside them.

Filed under  //   cvs   drupal   drupal 7   subversion  

SVN URL shortcuts

Typing repository URL's are not fun in subversion, most of them are really long and if you want to commit multiple files or merge, sometimes you have to type them more than once.


If you run svn info, you will notice the line that begins with URL:

Why don't we grab the contents of this line after the word URL: (so we are grabbing the URL itself), and put it in a shortcut.

so, create an alias in your .bashrc file:

alias sitesvn="svn info | egrep '^URL: (.*)' | sed s/URL\:\ //"

Now you can use a shortcut:

svn ls $(sitesvn)/trunk


Note: this might not work on *all* URL's, depending on how you have the SVN root setup.

Filed under  //   command line   subversion