The cvswrappers file

Wrappers refers to a cvsnt feature which lets you control certain settings based on the name of the file which is being operated on. The settings are -k for binary files, -x to define xdiff wrappers, -t to override default mime types, and -m for nonmergeable text files.

The basic format of the file cvswrappers is:

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

where option is one of
-m           update methodology      value: MERGE or COPY
-k           keyword expansion       value: expansion mode
-x           xdiff specification     value: name of xdiff DLL, plus options.
-t           mime type               value: new mime type

and value is a single-quote delimited value.

For example, the following command imports a directory, treating files whose name ends in .exe as binary:

cvs import -I ! -W "*.exe -kb" first-dir vendortag reltag

The -m option specifies the merge methodology that should be used when a non-binary file is updated. MERGE means the usual cvsnt behavior: try to merge the files. COPY means that cvs update will refuse to merge files, as it also does for files specified as binary with -kb (but if the file is specified as binary, there is no need to specify -m 'COPY'). cvsnt will provide the user with the two versions of the files, and require the user using mechanisms outside cvsnt, to insert any necessary changes. WARNING: do not use COPY with cvsnt 1.9 or earlier-such versions of cvsnt will copy one version of your file over the other, wiping out the previous contents. The -m wrapper option only affects behavior when merging is done on update; it does not affect how files are stored. See Chapter 10, Handling binary files, for more on binary files.

The -x option specifies the external diff program used when the cvs xdiff command is used. It is followed by the name of the xdiff library (which must always be relative to the predefined library root), and any optional parameters that the xdiff library requires. For example, to pass all .txt files through GNU diff:

*.txt -x "ext_xdiff diff -u --label \"%label1%\" \"%file1%\" \"%file2%\""

default wrappers

There are some kinds of files which are nearly always binary, and these have been given default wrappers of -kb within cvs. You can override these wrappers using -W ! on the command line or specifying ! in the first line of your cvswrappers files. If you do override these be sure to warn your users, who may be expecting default behaviour.

*.a   *.avi  *.bin  *.bmp  *.bz2  *.class  *.dll  *.exe  *.gif 
*.gz  *.hqx  *.ilk  *.lib  *.jar  *.jpg    *.jpeg *.mpg  *.mpeg 
*.mov *.mp3  *.ncb  *.o    *.ogg  *.obj    *.pdb  *.pdf  *.png 
*.ppt *.res  *.rpm  *.sit  *.so   *.tar    *.tgz  *.tif  *.tiff 
*.wmv *.xls  *.zip

In addition, a file pattern of *.* or just * will be used as a default where no wrappers exist. This pattern may also contain addive or subtractive wrapper options (eg -k+x), in which case it will always be applied.