The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by , 2016-03-07 04:49:04

svn-book

svn-book

Subversion Complete Reference

Name

svnlook log — Print the log message, followed by a newline character.

Synopsis

svnlook log REPOS_PATH

Description

Print the log message.

Options

--revision (-r)
--transaction (-t)

Examples

This shows the log output for revision 40 in our sample repository:
$ svnlook log /var/svn/repos/
Rearrange lunch.

379

Subversion Complete Reference

Name

svnlook propget (pget, pg) — 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.

Options

--revision (-r)
--revprop
--transaction (-t)

Examples

This shows the value of the “seasonings” property on the file /trunk/sandwich in the HEAD revision:
$ svnlook pg /var/svn/repos seasonings /trunk/sandwich
mustard

380

Subversion Complete Reference

Name

svnlook proplist (plist, pl) — Print the names and values of versioned file and directory properties.

Synopsis

svnlook proplist REPOS_PATH [PATH_IN_REPOS]

Description

List the properties of a path in the repository. With --verbose (-v), show the property values too.

Options

--revision (-r)
--revprop
--transaction (-t)
--verbose (-v)
--xml

Examples

This shows the names of properties set on the file /trunk/README in the HEAD revision:

$ svnlook proplist /var/svn/repos /trunk/README
original-author
svn:mime-type

This is the same command as in the preceding example, but this time showing the property values as well:

$ svnlook -v proplist /var/svn/repos /trunk/README
original-author : harry
svn:mime-type : text/plain

381

Subversion Complete Reference

Name

svnlook tree — Print the tree.

Synopsis

svnlook tree REPOS_PATH [PATH_IN_REPOS]

Description

Print the tree, starting at PATH_IN_REPOS (if supplied; at the root of the tree otherwise), optionally showing node revision IDs.

Options

--full-paths
--non-recursive (-N)
--revision (-r)
--show-ids
--transaction (-t)

Example

This shows the tree output for revision 13 in our sample repository:

$ svnlook tree -r 13 /var/svn/repos
/

trunk/
button.c
Makefile
integer.c

branches/
bookstore/
button.c
Makefile
integer.c



Use the --show-ids option to include node revision IDs (unique internal identifiers for specific nodes in Subversion's versioned
filesystem implementation):

$ svnlook tree -r 13 /var/svn/repos --show-ids
/ <0.0.r13/811>

trunk/ <1.0.r9/551>
button.c <2.0.r9/238>
Makefile <3.0.r7/41>
integer.c <4.0.r6/98>

branches/ <5.0.r13/593>
bookstore/ <1.1.r13/390>
button.c <2.1.r12/85>
Makefile <3.0.r7/41>
integer.c <4.1.r13/109>

382

Subversion Complete Reference


For output which lends itself more readily to being parsed by scripts, use the --full-paths option, which causes svnlook to
print the full repository path of each tree item and to not use indentation to indicate hierarchy:
$ svnlook tree -r 13 /var/svn/repos --show-ids
/ <0.0.r13/811>
trunk/ <1.0.r9/551>
trunk/button.c <2.0.r9/238>
trunk/Makefile <3.0.r7/41>
trunk/integer.c <4.0.r6/98>
branches/ <5.0.r13/593>
branches/bookstore/ <1.1.r13/390>
branches/bookstore/button.c <2.1.r12/85>
branches/bookstore/Makefile <3.0.r7/41>
branches/bookstore/integer.c <4.1.r13/109>


383

Subversion Complete Reference

Name

svnlook uuid — Print the repository's UUID.

Synopsis

svnlook uuid REPOS_PATH

Description

Print the UUID for the repository. The UUID is the repository's universal unique identifier. The Subversion client uses this identifi-
er to differentiate between one repository and another.

Options

None

Examples

$ svnlook uuid /var/svn/repos
e7fe1b91-8cd5-0310-98dd-2f12e793c5e8

384

Subversion Complete Reference

Name

svnlook youngest — Print the youngest revision number.

Synopsis

svnlook youngest REPOS_PATH

Description

Print the youngest revision number of a repository.

Options

None

Examples

This shows the youngest revision of our sample repository:

$ svnlook youngest /var/svn/repos/
42

svnsync—Subversion Repository Mirroring

svnsync is the Subversion remote repository mirroring tool. Put simply, it allows you to replay the revisions of one repository into
another one.
In any mirroring scenario, there are two repositories: the source repository, and the mirror (or “sink”) repository. The source repos-
itory is the repository from which svnsync pulls revisions. The mirror repository is the destination for the revisions pulled from the
source repository. Each of the repositories may be local or remote—they are only ever addressed by their URLs.
The svnsync process requires only read access to the source repository; it never attempts to modify it. But obviously, svnsync re-
quires both read and write access to the mirror repository.

svnsync is very sensitive to changes made in the mirror repository that weren't made as part of a mirroring operation.
To prevent this from happening, it's best if the svnsync process is the only process permitted to modify the mirror re-
pository.

svnsync Options

Options in svnsync are global, just as they are in svn and svnadmin:

--allow-non-empty
Disables the verification (which svnsync initialize performs by default) that the repository being initialized is empty of history
version.

--config-dir DIR
Instructs Subversion to read configuration information from the specified directory instead of the default location

385

Subversion Complete Reference

.subversion in the user's home directory).

--config-option CONFSPEC
Sets, for the duration of the command, the value of a runtime configuration option. CONFSPEC is a string which specifies the
configuration option namespace, name and value that you'd like to assign, formatted as FILE:SECTION:OPTION=[VALUE].
In this syntax, FILE and SECTION are the runtime configuration file (either config or servers) and the section thereof,
respectively, which contain the option whose value you wish to change. OPTION is, of course, the option itself, and VALUE
the value (if any) you wish to assign to the option. For example, to temporarily disable the use of the automatic property set-
ting feature, use --config-option=servers:global:http-library=serf. You can use this option multiple
times to change multiple option values simultaneously.

--disable-locking
Causes svnsync to bypass its own exclusive access mechanisms and operate on the assumption that its exclusive access to the
mirror repository is being guaranteed through some other, out-of-band mechanism.

--no-auth-cache
Prevents caching of authentication information (e.g., username and password) in the Subversion runtime configuration direct-
ories.

--non-interactive
In the case of an authentication failure or insufficient credentials, prevents prompting for credentials (e.g., username or pass-
word). This is useful if you're running Subversion inside an automated script and it's more appropriate to have Subversion fail
than to prompt for more information.

--quiet (-q)
Requests that the client print only essential information while performing an operation.

--revision (-r) ARG
Used by svnsync copy-revprops to specify a particular revision or revision range on which to operate.

--source-password PASSWD
Specifies the password for the Subversion server from which you are syncing. If not provided, or if incorrect, Subversion will
prompt you for this information as needed.

--source-prop-encoding ARG
Instructs svnsync to assume that translatable Subversion revision properties found in the source repository are stored using the
character encoding ARG and to transcode those into UTF-8 when copying them into the mirror repository.

--source-username NAME
Specifies the username for the Subversion server from which you are syncing. If not provided, or if incorrect, Subversion will
prompt you for this information as needed.

--steal-lock
Causes svnsync to steal, as necessary, the lock which it uses on the mirror repository to ensure exclusive repository access.
(This option should only be used when a lock exists in the mirror repository and is known to be stale—that is, when you are
certain that there are no other svnsync processes accessing that repository.)

--sync-password PASSWD
Specifies the password for the Subversion server to which you are syncing. If not provided, or if incorrect, Subversion will
prompt you for this information as needed.

--sync-username NAME
Specifies the username for the Subversion server to which you are syncing. If not provided, or if incorrect, Subversion will
prompt you for this information as needed.

--trust-server-cert
Used with --non-interactive to accept any unknown SSL server certificates without prompting.

386

Subversion Complete Reference

svnsync Subcommands

Here are the various subcommands for the svnsync program.

387

Subversion Complete Reference

Name

svnsync copy-revprops — Copy all revision properties for a particular revision (or range of revisions) from the source repository to
the mirror repository.

Synopsis

svnsync copy-revprops DEST_URL [SOURCE_URL]

svnsync copy-revprops DEST_URL REV[:REV2]

Description

Because Subversion revision properties can be changed at any time, it's possible that the properties for some revision might be
changed after that revision has already been synchronized to another repository. Because the svnsync synchronize command oper-
ates only on the range of revisions that have not yet been synchronized, it won't notice a revision property change outside that
range. Left as is, this causes a deviation in the values of that revision's properties between the source and mirror repositories. svn-
sync copy-revprops is the answer to this problem. Use it to resynchronize the revision properties for a particular revision or range
of revisions.

When SOURCE_URL is provided, svnsync will use it as the repository URL which the destination repository is mirroring. Gener-
ally, SOURCE_URL will be exactly the same source URL as was used with the svnsync initialize command when the mirror was
first set up. You may choose, however, to omit SOURCE_URL, in which case svnsync will consult the mirror repository's records
to determine the source URL which should be used.

We strongly recommend that you specify the source URL on the command-line, especially when untrusted users have
write access to the revision 0 properties which svnsync uses to coordinate its efforts.

Options

--config-dir DIR
--config-option CONFSPEC
--disable-locking
--no-auth-cache
--non-interactive
--quiet (-q)
--revision (-r) ARG
--source-password PASSWD
--source-prop-encoding ARG
--source-username NAME
--steal-lock
--sync-password PASSWD
--sync-username NAME
--trust-server-cert

Examples

Resynchronize the revision properties associated with a single revision (r6):

$ svnsync copy-revprops -r 6 file:///var/svn/repos-mirror \
http://svn.example.com/repos

388

Subversion Complete Reference
Copied properties for revision 6.
$

389

Subversion Complete Reference

Name

svnsync help — Help!

Synopsis

svnsync help

Description

This subcommand is useful when you're trapped in a foreign prison with neither a Net connection nor a copy of this book, but you
do have a local Wi-Fi network running and you'd like to sync a copy of your repository over to the backup server that Ira The
Knife is running over in cell block D.

Options

None

390

Subversion Complete Reference

Name

svnsync info — Print information about the synchronization of a destination repository.

Synopsis

svnsync info DEST_URL

Description

Print the synchronization source URL, source repository UUID and the last revision merged from the source to the destination re-
pository at DEST_URL.

Options

--config-dir DIR
--config-option CONFSPEC
--no-auth-cache
--non-interactive
--source-password PASSWD
--source-username NAME
--sync-password PASSWD
--sync-username NAME
--trust-server-cert

Examples

Print the synchronization information of a mirror repository:

$ svnsync info file:///var/svn/repos-mirror
Source URL: http://svn.example.com/repos
Source Repository UUID: e7fe1b91-8cd5-0310-98dd-2f12e793c5e8
Last Merged Revision: 47
$

391

Subversion Complete Reference

Name

svnsync initialize (init) — Initialize a mirror repository for synchronization from the source repository.

Synopsis

svnsync initialize MIRROR_URL SOURCE_URL

Description

svnsync initialize verifies that a repository meets the basic requirements of a new mirror repository and records the initial adminis-
trative information that associates the mirror repository with the source repository (specified by SOURCE_URL). This is the first
svnsync operation you run on a would-be mirror repository.

Ordinarily, SOURCE_URL is the URL of the root directory of the Subversion repository you wish to mirror. Subversion 1.5 and
newer allow you to use svnsync for partial repository mirroring, though — simply specify the URL of the source repository subdir-
ectory you wish to mirror as SOURCE_URL.

By default, the aforementioned basic requirements of a mirror are that it allows revision property modifications and that it contains
no version history. However, as of Subversion 1.7, you may now optionally disable the verification that the target repository is
empty using the --allow-non-empty option. While the use of this option should not become habitual (as it bypasses a valu-
able safeguard mechanism), it does aid in one very common use-case: initializing a copy of a repository as a mirror of the original.
This is especially handy when setting up new mirrors of repositories which contain a large amount of version history. Rather than
initialize a brand new repository as a mirror and then syncronize all of the history into it, administrators will find it significantly
faster to first make a copy of the mature repository (perhaps using svnadmin hotcopy) and then use svnsync initialize -
-allow-non-empty to initialize that copy as a mirror which is now already up-to-date with the original.

Options

--allow-non-empty
--config-dir DIR
--config-option CONFSPEC
--disable-locking
--no-auth-cache
--non-interactive
--quiet (-q)
--source-password PASSWD
--source-prop-encoding ARG
--source-username NAME
--steal-lock
--sync-password PASSWD
--sync-username NAME
--trust-server-cert

Examples

Fail to initialize a mirror repository due to inability to modify revision properties:

$ svnsync initialize file:///var/svn/repos-mirror \
http://svn.example.com/repos

svnsync: Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook
$

392








































































Click to View FlipBook Version