Next: [[cvs: Configuring Keyord Expansion#Configuring Keyord Expansion|Configuring keyword expansion]], Previous: [[cvs: Avoiding substitution#Avoiding substitution|Avoiding substitution]], Up: [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]] |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|

----

=== Substitution modes ===

Each file has a stored default substitution mode, and each working directory copy of a file also has a substitution mode. The former is set by the ‘`-k`’ option to `cvs add` and `cvs admin`; the latter is set by the ‘`-k`’ or ‘`-A`’ options to `cvs checkout` or `cvs update`. `cvs diff` also has a ‘`-k`’ option. For some examples, see [[cvs: Handling binary files#Handling binary files|Binary files]], and [[cvs: Merging and keywords#Merging and keywords|Merging and keywords]].

The modes available are:

;‘`-kkv`’ : Generate keyword strings using the default form, e.g. `$Revision: 5.7 $` for the `Revision` keyword.

;‘`-kkvl`’ : Like ‘`-kkv`’, except that a locker’s name is always inserted if the given revision is currently locked. The locker’s name is only relevant if `cvs admin -l` is in use.

;‘`-kk`’ : Generate only keyword names in keyword strings; omit their values. For example, for the `Revision` keyword, generate the string `$Revision$` instead of `$Revision: 5.7 $`. This option is useful to ignore differences due to keyword substitution when comparing different revisions of a file (see [[cvs: Merging and keywords#Merging and keywords|Merging and keywords]]).

;‘`-ko`’ : Generate the old keyword string, present in the working file just before it was checked in. For example, for the `Revision` keyword, generate the string `$Revision: 1.1 $` instead of `$Revision: 5.7 $` if that is how the string appeared when the file was checked in.

;‘`-kb`’ : Like ‘`-ko`’, but also inhibit conversion of line endings between the canonical form in which they are stored in the repository (linefeed only), and the form appropriate to the operating system in use on the client. For systems, like unix, which use linefeed only to terminate lines, this is very similar to ‘`-ko`’. For more information on binary files, see [[cvs: Handling binary files#Handling binary files|Binary files]]. In CVS version 1.12.2 and later ‘`-kb`’, as set by `cvs add`, `cvs admin`, or `cvs import` may not be overridden by a ‘`-k`’ option specified on the command line.

;‘`-kv`’ : Generate only keyword values for keyword strings. For example, for the `Revision` keyword, generate the string `5.7` instead of `$Revision: 5.7 $`. This can help generate files in programming languages where it is hard to strip keyword delimiters like `$Revision: $` from a string. However, further keyword substitution cannot be performed once the keyword names are removed, so this option should be used with care.

: One often would like to use ‘`-kv`’ with `cvs export`—see [[cvs: export--Export sources from CVS, similar to checkout#export—Export sources from CVS, similar to checkout|export]]. But be aware that doesn’t handle an export containing binary files correctly.

----

Next: [[cvs: Configuring Keyord Expansion#Configuring Keyord Expansion|Configuring keyword expansion]], Previous: [[cvs: Avoiding substitution#Avoiding substitution|Avoiding substitution]], Up: [[cvs: Keyword substitution#Keyword substitution|Keyword substitution]] |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|

This document was generated on a sunny day using [http://www.nongnu.org/texi2html/ texi2html].