If there is one thing I do with every new subversion repository, its create the standard layout of: trunk, tags, and branches. Then, I import any existing project files, if any exist. I’ve lost countless hours to this little dance. This script automates this process.
Here’s how it works:
First, it asks you for the URL of your new subversion repository. Then, the name of the folder you want your working copy to exist in. If that folder already exists it backs it up, then imports its contents into the trunk folder of the repository. Once that’s complete, it will remove the folder. Finally it performs a check out of your repository from trunk into the working copy you specified (regardless of whether or not you had a folder to begin with).
To Use:
- Unzip and stick the script somewhere in your PATH.
- Make the script executable: chmod +x newrepos
- Run newrepos from the directory where you want the working copy to be created (or pass a full system path to the file).
I was just doing this today… no joke.
You should make the import message something fun, like.
“AUTO-SHELL-SCRIPTED-BY-XENTEK: INITIAL IMPORT, YOU LAZY JERK”
Pingback: Automate Setting Up New SVN Repositories at xentek
Good Idea, the import now says:
Next step:
I want to look at the DruSH project and see if they have something like this, to put Drupal in SVN, create the sites/whatever/ folder, set some permissions, etc.
http://drupal.org/project/drush
Then I want to get one into the Zen theme – there are like 15 steps to setting up a new sub-theme.
http://drupal.org/node/226507