Subversion Tools and Contrib

The directories 'tools' and 'contrib' in the Subversion repository contain code that works with Subversion but that Subversion doesn't depend on for normal operations.

The files in 'tools' are maintained collectively by the Subversion project, and are under the same open source copyright as Subversion itself.

Code in contrib/ is open source, but may have a different license or copyright holder than Subversion itself. The Subversion project does not maintain these programs, but merely distributes them for our users' convenience.

The code is grouped into the following subdirectories:

Index by keyword

backup (tools/backup)

Perform a "hot" backup of a Berkeley DB repository. (and clean old logfiles after backup completes.)

bdb (tools/bdb)

Erases the text of every file in a BDB repository.

Related files: (tools/bdb)

A pretty-printer for subversion BDB repository databases.

Related files: (tools/bdb)

Print a description (including data, path, and revision) of the specified node reps in a Subversion filesystem. Walks as much of the reps table as necessary to locate the data (e.g. does a table scan).

Related files:


mirror_dir_through_svn.cgi (contrib/cgi)

This CGI script mirrors a source directory to a target directory using a Subversion repository as an intermediary. It's written as a CGI script so that remote users making changes to a WebDAV folder can tell the server to mirror the WebDAV folder contents to another directory on the system. See the example usage story below.

See also mirror_dir_through_svn.README

tweak-log.cgi (contrib/cgi)

It sure would be nice to be able to change the log messages on committed revisions of the Subversion repository via the web. This is a quick attempt at making that happen.


asvn (contrib/client-side)

Archive SVN (asvn) will allow the recording of file types not normally handled by svn. Currently this includes devices, symlinks and file ownership/permissions.

bash_completion (tools/client-side)

Programmable completion for the Subversion svn command under bash.

Related files: bash_completion_test

diff-to-logmsg.vim (contrib/client-side)

Converts a 'diff -urp' to a log message skeleton.

diff3wrap.bat (contrib/client-side)

Wrapper for running a diff3/merge program.

diffwrap.bat (contrib/client-side)

Wrapper for running a diff program.

mucc.c (contrib/client-side)

Multiple URL Command Client: Combine a list of mv, cp and rm commands on URLs into a single commit.

Related files: (contrib/client-side)

Show log messages matching a certain pattern. (tools/client-side)

Print a Subversion server's version number. (tools/client-side)

Show the log message and diff for a revision.

svn-clean (contrib/client-side)

Wipes out unversioned files from SVN working copy. (tools/client-side)

Produce a GraphViz .dot graph for the branch history of a node. (contrib/client-side)

Generate a nice log format for the Subversion repository.

svn-push.c (contrib/client-side/svn-push)

Propagate changesets from one (networked) repository to a different (networked) repository.

svn-resolve (contrib/client-side)

Resolve Subversion conflicts using FileMerge.

(FileMerge is a graphical diff tool in the Mac OS X Developer Tools.)

svn-viewdiff (contrib/client-side)

GNU diff wrapper for FileMerge.

(FileMerge is a graphical diff tool in the Mac OS X Developer Tools.)

svn.vim (contrib/client-side)

Vim syntax hilighting for SVN commit log message template. (contrib/client-side/svn2cl)

Front end shell script for svn2cl.xsl, calls xsltproc with the correct parameters.

See also README.

Related files: svn2cl.1 svn2cl.xsl svn2html.css svn2html.xsl (contrib/client-side)

Perl script that gets the revisions that modified a specified file or directory and prints the output of `svn diff' on between all revisions that that modified the file or directory. Good for seeing what changed over time and for tracking down when a particular line in a file changed. (contrib/client-side)

This script reads the auto-properties defined in the $HOME/.subversion/config file and applies them recursively to all the files and directories in the current working copy. (contrib/client-side)

Script to "export" from a Subversion repository a clean directory tree of empty files instead of the content contained in those files in the repository. The directory tree will also omit the .svn directories. This script was written to create a non-working working copy that can be crawled with find or find's locate utility to make it easier to find files. (contrib/client-side)

This Perl script is designed to load a number of directories into Subversion. This is useful if you have a number of .zip's or tar.{Z,gz,bz2}'s for a particular package and want to load them into Subversion.

See also svn_load_dirs.README.

Related files: svn_load_dirs_property_table.example (contrib/client-side)

Run svn update and force it to produce conflicts for all files which would be merged using diff3.

This is a workaround for issue 2048 which was fixed in r13383 and released in svn 1.2.0. (contrib/client-side)

Utility script for copying with branching/tagging.

See also svncopy.README.

Related files: (contrib/client-side)

Merge tracking script.

See also svnmerge.README. (contrib/client-side)

Merge tracking script, predecessor of

wcgrep (contrib/client-side)

Useful for greping in a subversion working copy. Essentially it behaves the same way your grep command does.

dev (tools/dev)

Check if a file has the proper license in it. (tools/dev)

Some Subversion project log messages include parseable data to help track who's contributing what. This script collects that data. (tools/dev)

This is a debugging script to test date-ordering in an SVN repository.

gcov.patch (tools/dev)

This patch can be used to generate a report showing what C source lines are executed when the testsuite is run. (tools/dev)

Terribly ugly hack of a script to verify the signatures on the release tarballs and produce the list of who signed them in the format we use for the announcements. (tools/dev)

A script to munge the output of 'svn log' into something approaching the style of a GNU ChangeLog. (tools/dev)

This was originally a quick hack to make a pretty picture of svn DAV servers. (tools/dev/iz)

Transform output into Excellable csv. (tools/dev/iz)

Produce a find/fix report for Subversion's IZ database. (tools/dev/iz)

Run some IssueZilla queries. (tools/dev)

Repository lock checker. Gets and exclusive lock on the provided repository, then runs db_stat to see if the lock counts have been reset to 0. If not, prints the timestamp of the run and a message about accumulation. (tools/dev)

Very annoyingly, the subversion mailing list archives mangle inline patches, and provide no raw message download facility (other than for an entire month's email as an mbox). So, I wrote this script, to demangle them. It's not perfect, as it has to guess about whitespace, but it does an acceptable job. (tools/dev)

Reads a Subversion dumpfile from DUMPFILE (or, if not provided, from stdin) and normalizes the metadata contained therein, printing summarized and sorted information. This is useful for generating data about dumpfiles in a diffable fashion. (tools/dev)

Read a single translation entry from the file F and return a tuple with the comments, msgid and msgstr. The comments is returned as a list of lines which do not end in new-lines. The msgid and msgstr are strings, possibly with embedded newlines. (tools/dev)

Purify a system, to simulate building Subversion on a "clean" box. (tools/dev)

Using the FILELIST (see config below), a series of COUNT commits will be constructed, each changing up to MAXFILES files per commit. The commands will be sent to stdout (formatted as a shell script). (tools/dev)

Makes multiple random file changes to a directory tree, for testing. (tools/dev)

A script that allows some simple testing of Subversion, in particular concurrent read, write and read-write access by the 'svn' client. It can also create working copy trees containing a large number of files and directories. All repository access is via the 'svnadmin' and 'svn' commands.

svn-dev.el (tools/dev)

Emacs Lisp help for writing Subversion code. This file contains some elisp functions which could be helpful to employ while working on Subversion.

svn-dev.vim (tools/dev)

This file sets vim up to use subversion's coding style. It can be applied on a per buffer basis with :source svn-dev.vim, or can be source from ~/.vimrc to apply settings to all files vim uses. For other variation try :help autocmd. (tools/dev)

This script is meant to ease the pain of merging and reviewing revision(s) on a release branch (although it can be used to merge and review revisions from any line of development to another). (tools/dev)

A program for analyzing Subversion trail usage statistics. (tools/dev)

This program is used to verify the FS history code. (tools/dev)

Insert or remove the GCC attribute "warn_unused_result" on each function that returns a Subversion error, in the specified files or, by default, *.h and *.c in the ./subversion and ./tools trees. (tools/dev)

Print semantic Subversion error code names mapped from their numeric error code values.


diff.c (tools/diff)

A diff program using subversions diff functions.

diff3.c (tools/diff)

A diff3 program using subversions diff functions.

diff4.c (tools/diff)

A diff4 program using subversions diff functions.

hook-scripts (contrib/hook-scripts)

A pre-commit hook to detect case-insensitive filename clashes.

This is *much* more efficient than but it does require Subversion 1.3.0 or later. (contrib/hook-scripts)

This script can be called from a pre-commit hook on either Windows or a Unix like operating system. It implements the checks required to ensure that the repository acts in a way which is compatible with a case preserving but case insensitive file system.

Superceded by for Subversion 1.3.0 and later. (contrib/hook-scripts)

Check that every added file has the svn:mime-type property set and every added file with a mime-type matching text/* also has svn:eol-style set. If any file fails this test the user is sent a verbose error message suggesting solutions and the commit is aborted. (tools/hook-scripts)

Uses the `svnlook' program to check if the user who submitted the commit has appropriate rights to perform the commit on all the modified files and directories using the permissions specified in the configuration file.

Related files: commit-access-control.cfg.example (contrib/hook-scripts)

A funny pre-commit hook example. (tools/hook-scripts)

Send a notification email describing either a commit or a revprop-change action on a Subversion repository.

Uses the `svnlook' program to send commit emails. Invoke it from `repository/hooks/post-commit'. Run the script with no arguments for usage.

commit-email.rb (tools/hook-scripts)

Uses the Ruby/SWIG client bindings to query the repository about the changes made by a particular revision, and send corresponding change emails. The program takes command-line options for basic setup and to fine-tune its behavior. (contrib/hook-scripts)

A pre-commit hook to detect changes that look like forgotten conflict markers.

enforcer (contrib/hook-scripts/enforcer)

This is a pre-commit hook that allows you to more easily specify a variety of rules that govern what may be committed to your repository.

Related files: enforcer.conf (tools/hook-scripts)

Ensures that log messages end with exactly one newline. Can also be run as a standalone script to fix up old revisions. (tools/hook-scripts/mailer)

Uses the Python/SWIG bindings to directly query the repository about the changes made by a particular revision. The program uses a configuration file for basic setup and to fine-tune where changes are delivered. Compared to, the output contains a bit more information about property changes, is smarter with binary files, and it streams its output into the mailer (to avoid in-memory buffering).

Related files: mailer.conf.example tests/ (contrib/hook-scripts)

A template for checks in a pre-commit hook. (contrib/hook-scripts)

This script, intended for use as a Subversion pre-lock hook, verifies that the PATH that USER is attempting to lock has the svn:needs-lock property set on it, returning success iff it does. (contrib/hook-scripts)

Generates a RSS 2.0 file containing commit information. (tools/hook-scripts)

Pre-commit hook that checks write permissions, similar to, but uses a different syntax. Run ' -h' for usage.

Related files: svnperms.conf.example (tools/hook-scripts)

This is a pre-commit hook that checks whether the contents of PO files committed to the repository are encoded in UTF-8.

po (tools/po)

Subversion po file translation status report generator. (tools/po)

Script for mailing status output from cronjobs.

server-side (contrib/server-side)

mod_python authorization handler for mod_authz_svn groups. (contrib/server-side)

This shell script demonstrates a backup/restore recipe for live Subversion repositories, using a standard full+incrementals process. (tools/server-side)

This script creates (incremental) dump files from a subversion repository on *IX. It is intended for use in cron jobs and post-commit hooks.

svn-fast-backup (contrib/server-side)

Use rsync snapshots for very fast FSFS repository backup. (contrib/server-side)

Whitewash the contents of a Subversion file and its successors.

svnauthz-validate.c (tools/server-side)

Load and validate an authz file. (contrib/server-side)

Mirror subversion repositories. This script supports pushing or pulling the changes via ssh and svn tools.


svnindex.xsl (tools/xslt)

A sample XML transformation style sheet for displaying the Subversion directory listing that is generated by mod_dav_svn when the "SVNIndexXSLT" directive is used.

Related files: svnindex.css