When used with CVS, the program is invoked from the CVSROOT/loginfo file as follows1:
ALL /usr/bin/vcsync --vcs-type=cvs --detach --sleep=2 -- %p %s
The --vcs-type option tells vcsync
which
VCS to use. You can omit it, as vcsync
is able to determine the kind of VCS it has been called
from (see VCS detection).
The --detach and --sleep options instruct it to
detach from the controlling terminal right after start up and wait for
two seconds before performing its job. These two options avoid
dead-locking condition which occurs when cvs update
is
invoked from the loginfo file.
The two dashes mark end of options. This is a precaution for cases
when expansion of %p
begins with a dash.
These options can be stored in the configuration file (see Configuration), which will look like:
# Define the VCS type (optional). vcs-type cvs; # Detach from the controlling terminal. detach yes; # Wait for the check in process to terminate. sleep 2; # Destination directory is located in this directory. destination-root /srv/home;
Given this configuration file, the line in CVSROOT/loginfo can be simplified to:
ALL /bin/vcsync -- %p %s
The CVS synchronization routine gets the name of the project (the
project part discussed in see Overview) from the value of the
environment variable CVSROOT
, by selecting its trailing
directory component. For example, given the configuration file above
and the setting CVSROOT=/var/cvsroot/foo
, vcsync
will
assume the destination directory to be /srv/home/foo.
If using old CVS format strings, the following line should be used instead:
ALL /usr/bin/vcsync --vcs-type=cvs --detach --sleep=2 -- %s
Such usage, however, is not recommended.