The utility svnrdump allows you to dump and load Subversion repositories, including the whole revision history.

A typical use case for svnrdump looks like this:

svnrdump dump <OLD-REPOSITORY-URL>  > my-repository.dump
svnrdump load <NEW-REPOSITORY-URL> < my-reposiotory.dump

To find out which revisions a particular dump file contains, grep comes in handy: The contained revision numbers are stored in plain text and in increasing order in the dump file.

grep -a "Revision-number:" my-repository.dump

returns all stored revisions. To find out the first or last contained revision, simply use head and tail:

grep -a "Revision-number:" my-repository.dump | head -n 1
grep -a "Revision-number:" my-repository.dump | tail -n 1

 

The version control system Subversion offers a nice feature called keywords. Keywords are a mechanism which allows to replace certain markers/placeholders in versioned text files with SVN metadata (author, last modified date, last modified revision, etc.). By default, keywords are disabled and may be activated with a specific SVN property called svn:keywords.  The corresponding chapter in the SVN book lists the available Keywords.

Keywords (in the example, the last modified date and revision) may either be activated for a single file:

svn propset svn:keywords "Date Revision" testfile.txt

or for a whole directory tree

svn propset svn:keywords "Date Revision" -R .

As of the next commit of the files, all occurrences of $Date$ and $Revision$ placeholders will be updated with the up-to-date metadata every time you commit the file:

$Date: 2013-05-01 10:08:40 +0200 (Wed, 01 May 2013) $
$Revision: 11 $

If you want to disable all keywords for a file/tree you use the propdel command:

svn propdel svn:keywords testfile.txt
svn propdel svn:keywords -R .

For disabling certain keywords there exists the propedit command which fires up a text editor:

svn propedit svn:keywords testfile.tx

Note that propedit only works for a single file/directory and has, by nature, no recursive option. A recursive alternative is to use propset svn:keywords -R with a new list of SVN keywords.

The following is a list of my favorite keywords:

Keyword| Placeholder| Example
Date $Date$ $Date: 2013-05-01 10:08:40 +0200 (Wed, 01 May 2013) $
Revision $Revision$ $Revision: 11 $
Author $Author$ $Revision: svenlogan $

Links

  • [1] SVN Keyword Substitution (Svnbook)