Wrappers allow you to set a hook which transforms files on their way in and out of CVS. Most or all of the wrappers features do not work with client/server CVS.
The file `cvswrappers' defines the script that will be
run on a file when its name matches a regular
expresion. There are two scripts that can be run on a
file or directory. One script is executed on the file/directory
before being checked into the repository (this is denoted
-t flag) and the other when the file is
checked out of the repository (this is denoted with the
The `cvswrappers' also has a `-m' option to
specify the merge methodology that should be used when
the file is updated.
MERGE means the usual
CVS behavior: try to merge the files (this
generally will not work for binary files).
cvs update will merely copy one
version over the other, and require the user using
mechanisms outside CVS, to insert any necessary
The `-m' wrapper option only affects behavior when
merging is done on update; it does not affect how files
are stored. See See section Handling binary files, for more on
The basic format of the file `cvswrappers' is:
wildcard [option value][option value]... where option is one of -f from cvs filter value: path to filter -t to cvs filter value: path to filter -m update methodology value: MERGE or COPY -k keyword expansion value: expansion mode and value is a single-quote delimited value.
*.nib -f 'unwrap %s' -t 'wrap %s %s' -m 'COPY' *.c -t 'indent %s %s'
The above example of a `cvswrappers' file
states that all files/directories that end with a
should be filtered with the `wrap' program before
checking the file into the repository. The file should
be filtered though the `unwrap' program when the
file is checked out of the repository. The
`cvswrappers' file also states that a
methodology should be used when updating the files in
the repository (that is no merging should be performed).
The last example line says that all files that end with
*.c should be filtered with `indent'
before being checked into the repository. Unlike the previous
example no filtering of the
*.c file is done when
it is checked out of the repository.
-t filter is called with two arguments,
the first is the name of the file/directory to filter
and the second is the pathname to where the resulting
filtered file should be placed.
-f filter is called with one argument,
which is the name of the file to filter from. The end
result of this filter will be a file in the users directory
that they can work on as they normally would.
For another example, the following command imports a directory, treating files whose name ends in `.exe' as binary:
cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag
Go to the first, previous, next, last section, table of contents.