Skip to Main Content
Version Control with Subversion, 2nd Edition
book

Version Control with Subversion, 2nd Edition

by C. Michael Pilato, Ben Collins-Sussman, Brian W. Fitzpatrick
September 2008
Intermediate to advanced content levelIntermediate to advanced
432 pages
13h 57m
English
O'Reilly Media, Inc.
Content preview from Version Control with Subversion, 2nd Edition

svnversion

svnversion is a program for summarizing the revision mixture of a working copy. The resultant revision number, or revision range, is written to standard output.

It’s common to use this output in your build process when defining the version number of your program:

svnversion [OPTIONS] [WC_PATH [TRAIL_URL]]

TRAIL_URL, if present, is the trailing portion of the URL used to determine whether WC_PATH itself is switched (detection of switches within WC_PATH does not rely on TRAIL_URL).

When WC_PATH is not defined, the current directory will be used as the working copy path. TRAIL_URL cannot be defined if WC_PATH is not explicitly given.

svnversion Options

Like svnserve, svnversion has no subcommands—only options:

--no-newline (-n)

Omits the usual trailing newline from the output.

--committed (-c)

Uses the last-changed revisions rather than the current (i.e., highest locally available) revisions.

--help (-h)

Prints a help summary.

--version

Prints the version of svnversion and exits with no error.

svnversion Examples

If the working copy is all at the same revision (e.g., immediately after an update), then that revision is printed out:

$ svnversion
4168

You can add TRAIL_URL to make sure the working copy is not switched from what you expect. Note that the WC_PATH is required in this command:

$ svnversion . /var/svn/trunk
4168

For a mixed-revision working copy, the range of revisions present is printed:

$ svnversion
4123:4168

If the working copy contains modifications, a trailing “M” is added: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Subversion Version Control: Using The Subversion Version Control System in Development Projects

Subversion Version Control: Using The Subversion Version Control System in Development Projects

William Nagel
Version Control with Git, 3rd Edition

Version Control with Git, 3rd Edition

Prem Kumar Ponuthorai, Jon Loeliger

Publisher Resources

ISBN: 9780596510336Errata Page