Name
svnadmin hotcopy — Make a hot copy of a repository.
Synopsis
svnadmin hotcopy REPOS_PATH NEW_REPOS_PATH
Description
This subcommand makes a full “hot” backup of your repository, including all hooks, configura-
tion files, and, of course, database files. If you pass the clean-logs option, svnadmin will
perform a hotcopy of your repository, and then remove unused Berkeley DB logs from the ori-
ginal repository. You can run this command at any time and make a safe copy of the reposit-
ory, regardless of whether other processes are using the repository.
Options
clean-logs
As described in the section called “Berkeley DB”, hot-copied Berkeley DB reposit-
ories are not portable across operating systems, nor will they work on machines
with a different “endianness” than the machine where they were created.
Subversion Complete Reference
275
Name
svnadmin list-dblogs — Ask Berkeley DB which log files exist for a given Subversion repository
(applies only to repositories using the bdb backend).
Synopsis
svnadmin list-dblogs REPOS_PATH
Description
Berkeley DB creates logs of all changes to the repository, which allow it to recover in the face
of catastrophe. Unless you enable DB_LOG_AUTOREMOVE, the log files accumulate, although
most are no longer used and can be deleted to reclaim disk space. See the section called
“Managing Disk Space” for more information.
Subversion Complete Reference
276
Name
svnadmin list-unused-dblogs — Ask Berkeley DB which log files can be safely deleted (applies
only to repositories using the bdb backend).
Synopsis
svnadmin list-unused-dblogs REPOS_PATH
Description
Berkeley DB creates logs of all changes to the repository, which allow it to recover in the face
of catastrophe. Unless you enable DB_LOG_AUTOREMOVE, the log files accumulate, although
most are no longer used and can be deleted to reclaim disk space. See the section called
“Managing Disk Space” for more information.
Examples
Remove all unused log files from a repository:
$ svnadmin list-unused-dblogs /path/to/repos
/path/to/repos/log.0000000031
/path/to/repos/log.0000000032
/path/to/repos/log.0000000033
$ svnadmin list-unused-dblogs /path/to/repos | xargs rm
## disk space reclaimed!
Subversion Complete Reference
277
Name
svnadmin load — Read a “dumpfile”-formatted stream from stdin.
Synopsis
svnadmin load REPOS_PATH
Description
Read a “dumpfile”-formatted stream from stdin, committing new revisions into the repository's
filesystem. Send progress feedback to stdout.
Options
quiet (-q)
ignore-uuid
force-uuid
use-pre-commit-hook
use-post-commit-hook
parent-dir
Example
This shows the beginning of loading a repository from a backup file (made, of course, with
svnadmin dump):
$ svnadmin load /usr/local/svn/restored < repos-backup
<<< Started new txn, based on original revision 1
* adding path : test done.
* adding path : test/a done.
…
Or if you want to load into a subdirectory:
$ svnadmin load parent-dir new/subdir/for/project /usr/local/svn/restored < repos-backup
<<< Started new txn, based on original revision 1
* adding path : test done.
* adding path : test/a done.
…
Subversion Complete Reference
278
Name
svnadmin lslocks — Print descriptions of all locks.
Synopsis
svnadmin lslocks REPOS_PATH
Description
Print descriptions of all locks in a repository.
Options
None
Example
This lists the one locked file in the repository at /svn/repos:
$ svnadmin lslocks /svn/repos
Path: /tree.jpg
UUID Token: opaquelocktoken:ab00ddf0-6afb-0310-9cd0-dda813329753
Owner: harry
Created: 2005-07-08 17:27:36 -0500 (Fri, 08 Jul 2005)
Expires:
Comment (1 line):
Rework the uppermost branches on the bald cypress in the foreground.
Subversion Complete Reference
279
Name
svnadmin lstxns — Print the names of all uncommitted transactions.
Synopsis
svnadmin lstxns REPOS_PATH
Description
Print the names of all uncommitted transactions. See the section called “Removing dead trans-
actions” for information on how uncommitted transactions are created and what you should do
with them.
Examples
List all outstanding transactions in a repository.
$ svnadmin lstxns /usr/local/svn/repos/
1w
1x
Subversion Complete Reference
280
Name
svnadmin recover — Bring a repository database back into a consistent state (applies only to
repositories using the bdb backend). In addition, if repos/conf/passwd does not exist, it will
create a default password file .
Synopsis
svnadmin recover REPOS_PATH
Description
Run this command if you get an error indicating that your repository needs to be recovered.
Options
wait
Examples
Recover a hung repository:
$ svnadmin recover /usr/local/svn/repos/
Repository lock acquired.
Please wait; recovering the repository may take some time
Recovery completed.
The latest repos revision is 34.
Recovering the database requires an exclusive lock on the repository. (This is a “database
lock”; see The three meanings of “lock”.) If another process is accessing the repository, then
svnadmin recover will error:
$ svnadmin recover /usr/local/svn/repos
svn: Failed to get exclusive repository access; perhaps another process
such as httpd, svnserve or svn has it open?
$
The wait option, however, will cause svnadmin recover to wait indefinitely for other pro-
cesses to disconnect:
$ svnadmin recover /usr/local/svn/repos wait
Waiting on repository lock; perhaps another process has it open?
### time goes by…
Repository lock acquired.
Please wait; recovering the repository may take some time
Recovery completed.
The latest repos revision is 34.
Subversion Complete Reference
281
Subversion Complete Reference
282
Name
svnadmin rmlocks — Unconditionally remove one or more locks from a repository.
Synopsis
svnadmin rmlocks REPOS_PATH LOCKED_PATH
Description
Remove lock from each LOCKED_PATH.
Options
None
Example
This deletes the locks on tree.jpg and house.jpg in the repository at /svn/repos
$ svnadmin rmlocks /svn/repos tree.jpg house.jpg
Removed lock on '/tree.jpg.
Removed lock on '/house.jpg.
Subversion Complete Reference
283
Name
svnadmin rmtxns — Delete transactions from a repository.
Synopsis
svnadmin rmtxns REPOS_PATH TXN_NAME
Description
Delete outstanding transactions from a repository. This is covered in detail in the section called
“Removing dead transactions”.
Options
quiet (-q)
Examples
Remove named transactions:
$ svnadmin rmtxns /usr/local/svn/repos/ 1w 1x
Fortunately, the output of lstxns works great as the input for rmtxns:
$ svnadmin rmtxns /usr/local/svn/repos/ `svnadmin lstxns /usr/local/svn/repos/`
Which will remove all uncommitted transactions from your repository.
Subversion Complete Reference
284
Name
svnadmin setlog — Set the log-message on a revision.
Synopsis
svnadmin setlog REPOS_PATH -r REVISION FILE
Description
Set the log-message on revision REVISION to the contents of FILE.
This is similar to using svn propset revprop to set the svn:log property on a revision, ex-
cept that you can also use the option bypass-hooks to avoid running any pre- or post-
commit hooks, which is useful if the modification of revision properties has not been enabled in
the pre-revprop-change hook.
Revision properties are not under version control, so this command will perman-
ently overwrite the previous log message.
Options
revision (-r) REV
bypass-hooks
Examples
Set the log message for revision 19 to the contents of the file msg:
$ svnadmin setlog /usr/local/svn/repos/ -r 19 msg
Subversion Complete Reference
285
Name
svnadmin verify — Verify the data stored in the repository.
Synopsis
svnadmin verify REPOS_PATH
Description
Run this command if you wish to verify the integrity of your repository. This basically iterates
through all revisions in the repository by internally dumping all revisions and discarding the out-
put—it's a good idea to run this on a regular basis to guard against latent hard disk failures and
“bitrot”. If this command fails—which it will do at the first sign of a problem—that means that
your repository has at least one corrupted revision and you should restore the corrupted revi-
sion from a backup (you did make a backup, didn't you?).
Examples
Verify a hung repository:
$ svnadmin verify /usr/local/svn/repos/
* Verified revision 1729.
svnlook
svnlook is a command-line utility for examining different aspects of a Subversion repository. It
does not make any changes to the repository—it's just used for “peeking”. svnlook is typically
used by the repository hooks, but a repository administrator might find it useful for diagnostic
purposes.
Since svnlook works via direct repository access (and thus can only be used on the machine
that holds the repository), it refers to the repository with a path, not a URL.
If no revision or transaction is specified, svnlook defaults to the youngest (most recent) revi-
sion of the repository.
svnlook Options
Options in svnlook are global, just like in svn and svnadmin; however, most options only ap-
ply to one subcommand since the functionality of svnlook is (intentionally) limited in scope.
no-diff-deleted
Prevents svnlook from printing differences for deleted files. The default behavior when a
file is deleted in a transaction/revision is to print the same differences that you would see if
you had left the file but removed all the content.
revision (-r)
Specify a particular revision number that you wish to examine.
revprop
Operates on a revision property instead of a property specific to a file or directory. This op-
Subversion Complete Reference
286
tion requires that you also pass a revision with the revision (-r) option.
transaction (-t)
Specify a particular transaction ID that you wish to examine.
show-ids
Show the filesystem node revision IDs for each path in the filesystem tree.
svnlook Subcommands
Subversion Complete Reference
287
Name
svnlook author — Print the author.
Synopsis
svnlook author REPOS_PATH
Description
Print the author of a revision or transaction in the repository.
Options
revision (-r) REV
transaction (-t)
Examples
svnlook author is handy, but not very exciting:
$ svnlook author -r 40 /usr/local/svn/repos
sally
Subversion Complete Reference
288
Name
svnlook cat — Print the contents of a file.
Synopsis
svnlook cat REPOS_PATH PATH_IN_REPOS
Description
Print the contents of a file.
Options
revision (-r) REV
transaction (-t)
Examples
This shows the contents of a file in transaction ax8, located at /trunk/README:
$ svnlook cat -t ax8 /usr/local/svn/repos /trunk/README
Subversion, a version control system.
=====================================
$LastChangedDate: 2003-07-17 10:45:25 -0500 (Thu, 17 Jul 2003) $
Contents:
I. A FEW POINTERS
II. DOCUMENTATION
III. PARTICIPATING IN THE SUBVERSION COMMUNITY
…
Subversion Complete Reference
289
Name
svnlook changed — Print the paths that were changed.
Synopsis
svnlook changed REPOS_PATH
Description
Print the paths that were changed in a particular revision or transaction, as well as “svn up-
date-style” status letters in the first two columns:
'A '
Item added to repository.
'D '
Item deleted from repository.
'U '
File contents changed.
' U'
Properties of item changed. Note the leading space.
'UU'
File contents and properties changed.
Files and directories can be distinguished, as directory paths are displayed with a trailing '/'
character.
Options
revision (-r) REV
transaction (-t)
Examples
This shows a list of all the changed files and directories in revision 39 of a test repository. Note
that the first changed item is a directory, as evidenced by the trailing /:
$ svnlook changed -r 39 /usr/local/svn/repos
A trunk/vendors/deli/
A trunk/vendors/deli/chips.txt
A trunk/vendors/deli/sandwich.txt
A trunk/vendors/deli/pickle.txt
U trunk/vendors/baker/bagel.txt
U trunk/vendors/baker/croissant.txt
UU trunk/vendors/baker/pretzel.txt
D trunk/vendors/baker/baguette.txt
Subversion Complete Reference
290
Name
svnlook date — Print the datestamp.
Synopsis
svnlook date REPOS_PATH
Description
Print the datestamp of a revision or transaction in a repository.
Options
revision (-r) REV
transaction (-t)
Examples
This shows the date of revision 40 of a test repository:
$ svnlook date -r 40 /tmp/repos/
2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)
Subversion Complete Reference
291
Name
svnlook diff — Print differences of changed files and properties.
Synopsis
svnlook diff REPOS_PATH
Description
Print GNU-style differences of changed files and properties in a repository.
Options
revision (-r) REV
transaction (-t)
no-diff-added
no-diff-deleted
Examples
This shows a newly added (empty) file, a deleted file, and a copied file:
$ svnlook diff -r 40 /usr/local/svn/repos/
Copied: egg.txt (from rev 39, trunk/vendors/deli/pickle.txt)
Added: trunk/vendors/deli/soda.txt
==============================================================================
Modified: trunk/vendors/deli/sandwich.txt
==============================================================================
trunk/vendors/deli/sandwich.txt (original)
+++ trunk/vendors/deli/sandwich.txt 2003-02-22 17:45:04.000000000 -0600
@@ -0,0 +1 @@
+Don't forget the mayo!
Modified: trunk/vendors/deli/logo.jpg
==============================================================================
(Binary files differ)
Deleted: trunk/vendors/deli/chips.txt
==============================================================================
Deleted: trunk/vendors/deli/pickle.txt
==============================================================================
If a file has a non-textual svn:mime-type property, then the differences are not explicitly
shown.
Subversion Complete Reference
292
Name
svnlook dirs-changed — Print the directories that were themselves changed.
Synopsis
svnlook dirs-changed REPOS_PATH
Description
Print the directories that were themselves changed (property edits) or whose file children were
changed.
Options
revision (-r) REV
transaction (-t)
Examples
This shows the directories that changed in revision 40 in our sample repository:
$ svnlook dirs-changed -r 40 /usr/local/svn/repos
trunk/vendors/deli/
Subversion Complete Reference
293
Name
svnlook help — Help!
Synopsis
Also svnlook -h and svnlook -?.
Description
Displays the help message for svnlook. This command, like its brother svn help, is also your
friend, even though you never call it anymore and forgot to invite it to your last party.
Alternate Names
?, h
Subversion Complete Reference
294
Name
svnlook history — Print information about the history of a path in the repository (or the root dir-
ectory if no path is supplied).
Synopsis
svnlook history REPOS_PATH [PATH_IN_REPOS]
Description
Print information about the history of a path in the repository (or the root directory if no path is
supplied).
Options
revision (-r) REV
show-ids
Examples
This shows the history output for the path /tags/1.0 as of revision 20 in our sample reposit-
ory.
$ svnlook history -r 20 /usr/local/svn/repos /tags/1.0 show-ids
REVISION PATH <ID>
19 /tags/1.0 <1.2.12>
17 /branches/1.0-rc2 <1.1.10>
16 /branches/1.0-rc2 <1.1.x>
14 /trunk <1.0.q>
13 /trunk <1.0.o>
11 /trunk <1.0.k>
9 /trunk <1.0.g>
8 /trunk <1.0.e>
7 /trunk <1.0.b>
6 /trunk <1.0.9>
5 /trunk <1.0.7>
4 /trunk <1.0.6>
2 /trunk <1.0.3>
1 /trunk <1.0.2>
Subversion Complete Reference
295
Name
svnlook info — Print the author, datestamp, log message size, and log message.
Synopsis
svnlook info REPOS_PATH
Description
Print the author, datestamp, log message size, and log message.
Options
revision (-r) REV
transaction (-t)
Examples
This shows the info output for revision 40 in our sample repository.
$ svnlook info -r 40 /usr/local/svn/repos
sally
2003-02-22 17:44:49 -0600 (Sat, 22 Feb 2003)
15
Rearrange lunch.
Subversion Complete Reference
296
Name
svnlook lock — If a lock exists on a path in the repository, describe it.
Synopsis
svnlook lock REPOS_PATH PATH_IN_REPOS
Description
Print all information available for the lock at PATH_IN_REPOS. If PATH_IN_REPOS is not
locked, print nothing.
Options
None
Examples
This describes the lock on the file tree.jpg.
$ svnlook lock /svn/repos tree.jpg
UUID Token: opaquelocktoken:ab00ddf0-6afb-0310-9cd0-dda813329753
Owner: harry
Created: 2005-07-08 17:27:36 -0500 (Fri, 08 Jul 2005)
Expires:
Comment (1 line):
Rework the uppermost branches on the bald cypress in the foreground.
Subversion Complete Reference
297
Name
svnlook log — Print the log message.
Synopsis
svnlook log REPOS_PATH
Description
Print the log message.
Options
revision (-r) REV
transaction (-t)
Examples
This shows the log output for revision 40 in our sample repository:
$ svnlook log /tmp/repos/
Rearrange lunch.
Subversion Complete Reference
298
Name
svnlook propget — Print the raw value of a property on a path in the repository.
Synopsis
svnlook propget REPOS_PATH PROPNAME [PATH_IN_REPOS]
Description
List the value of a property on a path in the repository.
Alternate Names
pg, pget
Options
revision (-r) REV
transaction (-t)
revprop
Examples
This shows the value of the “seasonings” property on the file /trunk/sandwich in the HEAD
revision:
$ svnlook pg /usr/local/svn/repos seasonings /trunk/sandwich
mustard
Subversion Complete Reference
299