You are heresubversion
subversion
Drupal Module Updater
This script will automatically update a drupal module if your drupal source code is stored in a Subversion respository. It first removes all files except for the .svn directories, then extracts the tarball for the new version of the module. Then it runs an svn status command to see which files are new, which files have been removed in the new version, and which files have changed. The difference between this and svn_load_dirs is that renames aren't handled (well svn_load_dirs doesn't really handle them very well either).
Limit Size of Subversion Commits With this Hook
We have experienced some abuse of our subversion repository at work recently. Someone committed 400 MB of data all at once including many object files, libraries, and executables. I did not get very harsh with the person who did this. Because a) I have no objection to binaries in subversion in the first place, b) I don't really know what he's working on, c) disk space is cheap and we are no where near capacity, and d) his commit was still smaller than a few commits we had a long time ago (which were legit). Still, if you just allow people to commit whatever they want to your subversion repository, in the worst case, you could run out of disk space, necessitating an svn dump-and-load onto a new larger drive (pain). It would suck to have to do that just because some people were committing large binaries (without any legitimate reason to). There are other annoying consequences. Our tarball backups of svn currently fit on a DVD, which is cheap and easy, if we allowed this abuse to continue it would complicate our backup process.
What I wanted was a way to limit the commit size for certain users automatically. There did not seem to be any hooks out there to do this, so I wrote one.
Just paste the following into your pre-commit hook:
/svn/repos/hooks/check_txn_size.py "$REPOS" "$TXN" || exit 1
and paste the following into a check_txn_size.py file in your hooks directory and make it executable.
Maintaining Vendor Sources With Subversion
Here is how I upgrade my Drupal sites (which have their own customizations) to new versions of drupal core when they become available, as I mentioned in a previous post.
This section of the subversion book pretty much explains it. Here is specifically what I did for Drupal, assuming you already have some directories set up as follows:
/var/svn/repos/www/vendor/drupalcore /var/svn/repos/www/vendor/drupalcore/4.7.2 /var/svn/repos/www/vendor/drupalcore/4.7.3 /var/svn/repos/www/vendor/drupalcore/4.7.4 /var/svn/repos/www/vendor/drupalcore/current /var/svn/repos/www/drupal4.7
Small Gotcha When Copying Paths With Subversion
I was trying to do an svn copy from a specific server path into a local working copy. I basically wanted to copy over the vanilla mediawiki-1.8.1 sources from my repository into a local directory (called trunk). Here is what I did:
svn copy svn+ssh://david@server/svn/repos/Projects/wiki/mediawiki/1.8.1 ./trunk
You would think that this would copy the contents of the 1.8.1 directory into the trunk directory. Wrong; it copies the 1.8.1 directory and its contents into the trunk directory, thus creating a 1.8.1 directory inside trunk. It took me forever to figure out why it was doing this instead of what I wanted it to do (which is to copy the contents of 1.8.1, not the 1.8.1 directory itself).