Version Control with Subversion - Repository Maintenance - svnlook
is a tool provided by
Subversion for examining the various revisions and
transactions in a repository. No part of this program
attempts to change the repository—it's a
is typically used by the repository hooks for reporting the
changes that are about to be committed (in the case of the
hook) or that were just
committed (in the case of the
hook) to the repository. A repository administrator may use
this tool for diagnostic purposes.
has a straightforward
$ svnlook help
general usage: svnlook SUBCOMMAND REPOS_PATH [ARGS & OPTIONS ...]
Note: any subcommand which takes the '--revision' and '--transaction'
options will, if invoked without one of those options, act on
the repository's youngest revision.
Type "svnlook help <subcommand>" for help on a specific subcommand.
Nearly every one of
subcommands can operate on either a revision or a
transaction tree, printing information about the tree
itself, or how it differs from the previous revision of the
repository. You use the
--transaction options to specify which
revision or transaction, respectively, to examine. Note
that while revision numbers appear as natural numbers,
transaction names are alphanumeric strings. Keep in mind
that the filesystem only allows browsing of uncommitted
transactions (transactions that have not resulted in a new
revision). Most repositories will have no such
transactions, because transactions are usually either
committed (which disqualifies them from viewing) or aborted
In the absence of both the
will examine the youngest (or
“HEAD”) revision in the repository. So the
following two commands do exactly the same thing when 19 is
the youngest revision in the repository located at
$ svnlook info /path/to/repos
$ svnlook info /path/to/repos --revision 19
The only exception to these rules about subcommands is
takes no options, and simply prints out the
HEAD revision number.
$ svnlook youngest /path/to/repos
is designed to be
both human- and machine-parsable. Take as an example the output
$ svnlook info /path/to/repos
2002-11-04 09:29:13 -0600 (Mon, 04 Nov 2002)
Added the usual
The output of the
info subcommand is
The author, followed by a newline.
The date, followed by a newline.
The number of characters in the log message,
followed by a newline.
The log message itself, followed by a newline.
This output is human-readable, meaning items like the
datestamp are displayed using a textual representation
instead of something more obscure (such as the number of
nanoseconds since the Tasty Freeze guy drove by). But this
output is also machine-parsable—because the log
message can contain multiple lines and be unbounded in
provides the length of
that message before the message itself. This allows scripts
and other wrappers around this command to make intelligent
decisions about the log message, such as how much memory to
allocate for the message, or at least how many bytes to skip
in the event that this output is not the last bit of data in
Another common use of
actually view the contents of a revision or transaction
the directories and files in the requested tree. If you
--show-ids option, it will also
show the filesystem node revision IDs for each of those
paths (which is generally of more use to developers than to
$ svnlook tree /path/to/repos --show-ids
Once you've seen the layout of directories and files in
your tree, you can use commands like
to dig into the details
of those files and directories.
can perform a variety of
other queries, displaying subsets of bits of information
we've mentioned previously, reporting which paths were
modified in a given revision or transaction, showing textual
and property differences made to files and directories, and
so on. The following is a brief description of the current
list of subcommands accepted by
and the output of those subcommands:
Print the tree's author.
Print the contents of a file in the tree.
List all files and directories that changed in the
Print the tree's datestamp.
Print unified diffs of changed files.
List the directories in the tree that were
themselves changed, or whose file children were
Display interesting points in the history of a
versioned path (places where modifications or copies
Print the tree's author, datestamp, log message
character count, and log message.
If a path is locked, describe the lock attributes.
Print the tree's log message.
Print the value of a property on a path in the
Print the names and values of properties set on paths
in the tree.
Print the tree listing, optionally revealing the
filesystem node revision IDs associated with each
Print the repository's UUID—
Print the youngest revision number.
[an error occurred while processing this directive]