Wrappers -- CVS---Concurrent Versions System



Next: commit files Prev: modules Up: Administrative files Top: Top

The cvswrappers file

Wrappers allow you to set a hook which transforms files on their way in and out of 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 with the -t flag) and the other when the file is checked out of the repository (this is denoted with the -f flag)

The cvswrappers also specifies the merge methodology that should be used when the file is updated, that is should a MERGE or a straight COPY of the diferences be used when checking into the repository.

The basic format of the file cvswrappers is given as such:

wildcard     [option value][option value]...

where option is one of

-f from cvs filter value: path tofilter

-t to cvs filter value: path to filter

-m update methodology value: MERGE or COPY

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 .nib 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 COPY 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 a *.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. The -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.

The -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.



Next: commit files Prev: modules Up: Administrative files Top: Top