home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / cvs.man < prev    next >
Text File  |  1992-01-14  |  48KB  |  988 lines

  1. NAME
  2.      cvs - Concurrent Versions System
  3.  
  4. SYNOPSIS
  5.      cvs [ cvs_options ] cvs_command [ command_options ] [
  6.      command_args ]
  7.  
  8. DESCRIPTION
  9.      cvs is a front end to the rcs(l) revision control system
  10.      which extends the notion of revision control from a collec-
  11.      tion of files in a single directory to a hierarchical col-
  12.      lection of directories consisting of revision controlled
  13.      files.  These directories and files can be combined together
  14.      to form a software release.  cvs provides the functions
  15.      necessary to manage these software releases and to control
  16.      the concurrent editing of source files among multiple
  17.      software developers.
  18.  
  19.      The following list summarizes some of the strong points of
  20.      cvs:
  21.  
  22.      +    Only a single copy of the master sources exist.  This
  23.           copy is called the source ``repository'' and, through
  24.           administrative actions, contains all the information to
  25.           extract previous software releases at any time based on
  26.           either a symbolic revision tag, or a date in the past.
  27.  
  28.      +    Individual software developers check out private copies
  29.           of the sources into their personal work space.  These
  30.           private sources can be edited at any time and checked
  31.           back into the source repository as a permanent change.
  32.           cvs takes special care to ensure that a file is up-to-
  33.           date with the current revision in the source repository
  34.           before allowing it to be added as a permanent change.
  35.  
  36.      +    There is a facility for software developers to bring
  37.           their private copies of the sources up-to-date with the
  38.           currently checked in revisions, while at the same time
  39.           preserving any modifications that have been made to
  40.           their private sources.  This allows multiple developers
  41.           to be concurrently working on the same source files
  42.           without regard for what the other guy is doing.
  43.  
  44.           Note that this is the biggest change from the way most
  45.           other revision control systems, like RCS or SCCS work,
  46.           which allow only one developer to ever be changing a
  47.           file, since the file must be checked out as ``locked''
  48.           for the exclusive use of that person.  cvs instead
  49.           never applies an RCS lock to a checked out file until
  50.           the moment before it is to be checked back in as a per-
  51.           manent change.  Concurrency checks are performed on the
  52.           soon-to-be checked in file and the file must be up-to-
  53.           date before it can be made permanent.  In this way, cvs
  54.           allows individuals the freedom to change any file at
  55.           will, and provides the tools necessary to point out, if
  56.           not resolve, any conflicts that may be generated by
  57.           allowing this extra, and necessary, freedom.
  58.  
  59.      +    cvs has direct support for tracking source releases
  60.           from third-party vendors.  The checkin(l) program is
  61.           used to initially setup the source repository.  The
  62.           branch support of RCS is used to build the vendor
  63.           release as a branch off the main (local) RCS trunk.
  64.           Once this is done, developers can check out files and
  65.           make local changes to the vendor's source distribution.
  66.           The act of checking in a local change to a vendor's
  67.           source distribution moves the RCS branch from tracking
  68.           the third-party vendor's release to the main (local)
  69.           RCS trunk so that the local version of the file is used
  70.           forever more.
  71.  
  72.           When a new version of the vendor's source distribution
  73.           (or even a minor version consisting of a small subset
  74.           of files) arrives, the checkin program is used again to
  75.           add the new vendor release to the already existing
  76.           source repository.  For files that have not been
  77.           changed locally, the new file from the vendor becomes
  78.           the current revision.  For files that have been modi-
  79.           fied locally, checkin warns that the file must be
  80.           merged manually with the new vendor release.  The join
  81.           command of cvs is a useful tool that aids this manual
  82.           merge process (see below).
  83.  
  84.      +    A vendor release or a local release can be given a sym-
  85.           bolic tag name that is stored directly in the RCS
  86.           files.  This tag can be used at any time in the future
  87.           to get an exact copy of any previous release.  With
  88.           equal ease, one can also extract an exact copy of the
  89.           source files as of any arbitrary date in the past as
  90.           well.
  91.  
  92.      +    All changes that are made to the source repository are
  93.           carefully logged in a file, notesfile, or news data-
  94.           base, which can be used to produce release notices.
  95.           cvs can be configured to send log updates through one
  96.           or more filter programs, based on a regular expression
  97.           match on the directory that is being changed.  This
  98.           allows multiple related or unrelated projects to exist
  99.           within a single cvs source repository tree, with each
  100.           different project sending their checkin reports to a
  101.           unique log device for the project.
  102.  
  103.      +    There is support for a simple, yet powerful, ``module''
  104.           database.  This database can be used to apply names to
  105.           collections of directories and files as a matter of
  106.           convenience when checking out smaller pieces of a
  107.           larger software distribution.  This allows one to
  108.           checkout the ``diff'' program, for example, without
  109.           ever requiring the knowledge that the sources to
  110.           ``diff'' actually reside in the ``bin/diff'' directory.
  111.  
  112.           The module database also has limited support for an
  113.           aliasing capability.  This is useful for programs that
  114.           share sources from completely disjoint directories.
  115.           The aliasing feature can also be used to limit a named
  116.           release to a certain collection of directories and
  117.           files, to only work with pieces of the source found in
  118.           the entire source repository.
  119.  
  120.      +    There is direct support for determining which files
  121.           have changed since a previous release, or from a par-
  122.           ticular date.  As well, cvs can create a patch(l) for-
  123.           mat output file which can be used to bring a previously
  124.           released software distribution current with the newest
  125.           release.  One can create a patch file between two
  126.           tagged revisions, between a revision and some date in
  127.           the past, between two dates, or between a date or revi-
  128.           sion and the current ``head'' revision.
  129.  
  130.      The remainder of this manual page will document how all
  131.      these actions can be done using the cvs program.
  132.  
  133. OPTIONS
  134.      cvs accepts a number of options that override the current
  135.      setting of the recognized environment variables.
  136.  
  137.      -r   Checks out files read-only.  Same effect as if the
  138.           CVSREAD environment variable is set.
  139.  
  140.      -w   Checks out files read-write (default).  Overrides the
  141.           setting of the CVSREAD environment variable.
  142.  
  143.      -v   Outputs version and copyright information for cvs, then
  144.           exits.
  145.  
  146.      -d CVS_root_directory
  147.           Use CVS_root_directory as the root directory pathname
  148.           of the master RCS source repository.  Overrides the
  149.           setting of the CVSROOT environment variable.
  150.  
  151.      -b bindir
  152.           Use bindir as the directory to find RCS programs
  153.           within.  Overrides the setting of the RCSBIN environ-
  154.           ment variable.
  155.  
  156.      -e editor
  157.           Use editor for editing revision log information.  Over-
  158.           rides the setting of the EDITOR environment variable.
  159.  
  160.      -H   Displays usage information about the specified
  161.           cvs_command without actually executing said command.
  162.  
  163. USAGE
  164.      A cvs_command must be specified to cvs which drives the
  165.      specific release control function that is performed.  Each
  166.      cvs command accepts options and arguments unique to the com-
  167.      mand.  The usage statements for each command can be
  168.      displayed by specifying the -H option to the command.
  169.  
  170.      The available commands are listed below along with a
  171.      description of their function.  Command options unique to
  172.      the command are described in this section with the command
  173.      description.  Common command options are described fully in
  174.      the following section.
  175.  
  176.      checkout [-Qqlfnp] [-c] [-r tag|-D date_spec] modules...
  177.           Checks out the source files defined by modules.  This
  178.           command is used to get a private copy of the current
  179.           sources that can be edited and processed by most of the
  180.           other cvs commands.  checkout must be done before many
  181.           of the other cvs commands are used, since most of them
  182.           operate on checked out sources.
  183.  
  184.           Depending on the modules specified, checkout may recur-
  185.           sively create directories and populate them with the
  186.           appropriate source files.  These source files can then
  187.           be edited at any time (regardless of whether other
  188.           software developers are editing their private copies of
  189.           the sources), updated to include new changes checked
  190.           into the source repository, or committed as a permanent
  191.           change to the RCS repository.
  192.  
  193.           Note that checkout is used to create directories.  The
  194.           top-level directory created is always added to the
  195.           working directory where checkout is invoked, and usu-
  196.           ally has the same name as the specified module.  In the
  197.           case of a module alias, the created sub-directory may
  198.           have a different name, but you can be sure that it will
  199.           be a sub-directory, and that checkout will show the
  200.           relative path leading to each file as it is extracted
  201.           into your private work area, unless the -Q option is
  202.           specified.
  203.  
  204.           Running checkout on a directory that was already built
  205.           by checkout is also OK.  This has the same effect as
  206.           specifying the -d option to the update command
  207.           described below.
  208.  
  209.           The -c option ``cat''s the module file, sorted, to the
  210.           standard output, and does not cause any files or direc-
  211.           tories to be checked out.
  212.  
  213.           co can be specified instead of checkout to save some
  214.           typing.  See the MODULES section below for a complete
  215.           description of modules.
  216.  
  217.      update [-Qqlfp] [-d] [-r tag|-D date_spec] files...
  218.           After checkout is run, directories and files have been
  219.           extracted from the source repository for your personal
  220.           editing.  At any time that is convenient in your
  221.           development process, the update command can be run from
  222.           within the directory that contains the checked out
  223.           sources to bring those sources current with any revi-
  224.           sions that have been checked into the source repository
  225.           since they were last checked out or updated.
  226.  
  227.           Normally, update brings the current directory up-to-
  228.           date, then descends any sub-directories, bringing them
  229.           up-to-date as well.  This can be overridden by specify-
  230.           ing a list of files that should only be updated, or by
  231.           using the -l option which causes update to only process
  232.           the current directory, ignoring any sub-directories.
  233.  
  234.           If any special options were initially specified to
  235.           checkout when the source were initially checked out,
  236.           these exact options should be specified to update as
  237.           well to keep the sources consistent with the way they
  238.           were originally checked out.  For example, checking out
  239.           sources by specifying the ``-r V1_0'' option will check
  240.           out the revisions associated with the V1_0 release tag.
  241.           A subsequent update that does not specify this exact -r
  242.           option as well will revert to updating the sources with
  243.           the current revisions as stored in the source reposi-
  244.           tory, rather than those revisions associated with the
  245.           V1_0 release.
  246.  
  247.           For a complete description of the algorithm that update
  248.           uses to bring your source up-to-date, refer to the CON-
  249.           FLICT RESOLUTION section below.
  250.  
  251.      commit [-fn] [-a] [-m 'log_message'] [-
  252.           r revision] [files...]
  253.           At any point, changes that you have made to your
  254.           private copies of the sources may be committed to the
  255.           source repository as a permanent change.  commit does
  256.           not do a recursive commit, so each individual directory
  257.           must be checked in separately, even if the changes were
  258.           related.
  259.  
  260.           commit verifies that the selected files are up-to-date
  261.           with the current revisions in the source repository and
  262.           will abort without committing if any of the specified
  263.           files must be made current first with the update com-
  264.           mand.  With the -a option, all relevant files of the
  265.           current directory are examined.  commit is careful to
  266.           only check in those files that have really changed.
  267.           Note that commit does not update the out-of-date files
  268.           for you, but rather leaves that for you to do when the
  269.           time is right.
  270.  
  271.           An RCS identification string ($Id) must exist in the
  272.           modified files that are to be checked in.  If the iden-
  273.           tification string cannot be found in any of the files,
  274.           commit will prompt you for verification before proceed-
  275.           ing.  This prompt is bypassed if the -f option has been
  276.           specified.
  277.  
  278.           When all is well, an editor is invoked for the purpose
  279.           of entering a log message that will be written to one
  280.           or more logging programs and placed in the RCS source
  281.           repository file.  The log message may be specified on
  282.           the command line with the -m option, thus suppressing
  283.           the editor invocation.
  284.  
  285.           ci can be specified instead of commit to save some typ-
  286.           ing.
  287.  
  288.      diff [rcsdiff_options] [files...]
  289.           Your checked out files can be diffed against the origi-
  290.           nal revisions they were based upon with the diff com-
  291.           mand.  See rcsdiff(l) for a list of accepted options.
  292.           If no files are specified, diff will only ``diff''
  293.           those files in the current directory that are different
  294.           than the checked out revision (i.e. ones that you have
  295.           changed), or that are different than a specified revi-
  296.           sion.  If files are specified, only those files are
  297.           diffed.
  298.  
  299.           Two revisions may be specified as well.  In which case
  300.           your private sources are not diffed at all.  Instead,
  301.           the two revisions specified are diffed.
  302.  
  303.      log [rlog_options] [files...]
  304.           To display revision log information equivalent to the
  305.           rlog(l) program, the log command is used.  See rlog(l)
  306.           for a list of accepted options.  If no files are speci-
  307.           fied, log will run an rlog (with the arguments asa
  308.           specified) on every file under cvs control in the
  309.           current directory.  If files are specified, the log
  310.           information of only those files is displayed.
  311.  
  312.      status [files...]
  313.           Displays three lines of information for each of its
  314.           argument files, one for the user file (line 1), one for
  315.           the newest RCS file showing the current ``head'' revi-
  316.           sion number (line 3), and one for the RCS file both
  317.           derive from showing the date it was last updated (line
  318.           2).
  319.  
  320.      add [-m 'message'] files...
  321.           To permanently create a new file or directory in the
  322.           RCS source repository, the add command is used.  The
  323.           files or directories specified to add must already
  324.           exist in the current directory (which must have been
  325.           created with the checkout command).  For adding a whole
  326.           new directory hierarchy to the source repository that
  327.           was received from a third-party vendor, see the
  328.           checkin(l) program for how to do this.
  329.  
  330.           If the argument refers to an immediate sub-directory,
  331.           the directory is created at the correct place in the
  332.           RCS source repository and the necessary cvs administra-
  333.           tion files are created within the argument directory.
  334.           It is not considered an error if the RCS source reposi-
  335.           tory directory already exists.  Thus, to add a direc-
  336.           tory to your private sources that was created after you
  337.           had done your checkout of the sources, you can do the
  338.           following:
  339.  
  340.                     example% mkdir new_directory
  341.                     example% cvs add new_directory
  342.                     example% cvs update new_directory
  343.  
  344.           For each added file, a description of the file's pur-
  345.           pose is read from the terminal in RCS fashion, unless
  346.           the -m option is specified, in which case the argument
  347.           message is used instead.  This description will become
  348.           a permanent part of the created RCS file.
  349.  
  350.           The added files are not placed in the RCS source repo-
  351.           sitory until they are committed as a permanent change.
  352.           Doing an add on a file that has been removed with the
  353.           remove command will resurrect the file, unless it has
  354.           already been committed.
  355.  
  356.      remove files...
  357.           Marks the specified files as removed on purpose from
  358.           the current directory in the source repository.  The
  359.           specified files must no longer exist in the current
  360.           directory when the remove command is issued.  The files
  361.           are not actually removed until they are committed, at
  362.           which point their respective RCS files in the source
  363.           depository are moved into the Attic directory within
  364.           the source repository.  To restore a committed removed
  365.           file to the present version requires an administrator
  366.           to physically move the RCS file out of the Attic and
  367.           back into its parent directory.
  368.  
  369.      join [-Qqf] [-r tag|-D date_spec] files...
  370.           The intended purpose of the join command is to perform
  371.           the logical merge of a new vendor release installed
  372.           with the checkin(l) command with locally modified files
  373.           from a previous vendor release.  The checkin program
  374.           will inform you that a vendor file has been locally
  375.           modified and it is up to you to resolve the two
  376.           branches of development (local and vendor) into a uni-
  377.           fied revision that will be committed as a permanent
  378.           change to the source repository on the main (local)
  379.           trunk.  The join command will usually be used with the
  380.           -r option to specify the vendor tag that is to be
  381.           merged with the local changes.  This merge is handled
  382.           by RCS and the resultant file is placed in the current
  383.           directory (within your private work space) and any con-
  384.           flicts during the merge are displayed.
  385.  
  386.           After correcting any conflicts during the merge, commit
  387.           the joined file as usual with a modified file, and the
  388.           result (with a bit of work, perhaps) should be a
  389.           working combination of the local changes and the vendor
  390.           changes.
  391.  
  392.      The following commands do their work entirely within the RCS
  393.      source repository and, as such, do not require that a
  394.      checkout be done first.  These commands are usually of
  395.      interest only to the person responsible for the release pro-
  396.      cedures of a software package.  See the MODULE SUPPORT sec-
  397.      tion below for a full description of what a module is.
  398.  
  399. modules...
  400.      patch [-Qqlf] [-s|-t] [-r tag|-D date_spec [-r tag|-
  401.           D date_spec]]
  402.           Builds a Larry Wall format patch(l) file between two
  403.           releases that can be fed directly into the patch pro-
  404.           gram to bring an old release up-to-date with the new
  405.           release.  The diff output is sent to the standard out-
  406.           put device.  Note that any combination of one or two
  407.           revisions or dates may be specified.  If only one revi-
  408.           sion or date is specified, the patch is made between
  409.           that revision or date and the current ``head'' revi-
  410.           sions in the RCS file.
  411.  
  412.           Note that if the software release that is being patched
  413.           is contained in more than one directory, then it may be
  414.           necessary to specify the -p option to the patch(l) com-
  415.           mand when patching the old sources, so that patch(l) is
  416.           able to find the files that are located in other direc-
  417.           tories.
  418.  
  419.           If the -s option is specified, a patch file is not pro-
  420.           duced.  Instead, a description of the changed or added
  421.           files between the two releases is sent to the standard
  422.           output device.  This is useful for finding out, for
  423.           example, which files have changed between two dates or
  424.           revisions.
  425.  
  426.           If the -t option is specified, a diff of the top two
  427.           revisions is sent to the standard output device.  This
  428.           is most useful for seeing what the last change to a
  429.           file was.
  430.  
  431.      tag [-Qqlfn] [-d] [-r tag|-
  432.           D date_spec] symbolic_tag modules...
  433.           Sources in the repository can have a symbolic tag asso-
  434.           ciated with them.  This allows one to ``snapshot'' the
  435.           current sources when the software freeze date of a pro-
  436.           ject arrives, and as bugs are fixed after the freeze
  437.           date, only those changed sources that are to be part of
  438.           the release need be re-tagged.
  439.  
  440.           The symbolic tags are meant to permanently record which
  441.           revisions of which files were used in creating a
  442.           software distribution.  The functionality provided with
  443.           the checkout and update commands allow one to extract
  444.           an exact copy of this release at any time in the
  445.           future, regardless of whether files have been added or
  446.           removed since the release was tagged.  So in general,
  447.           these symbolic names of software distributions should
  448.           not be removed, but the -d option is provided as a
  449.           means to remove completely obsolete symbolic names if
  450.           necessary (as might be the case for an Alpha release,
  451.           say).  It is also possible to only tag files that
  452.           already contain a certain tag.  This method would be
  453.           used to rename a tag - tag only the files with the old
  454.           tag, then delete the old tag leaving the new tag which
  455.           would tag the exact same files as the old tag.
  456.  
  457. COMMAND OPTIONS
  458.      The following options are common to more than one of the cvs
  459.      commands, and are explained in detail here once, for brev-
  460.      ity.
  461.  
  462.      -Q   Causes the command to be really quiet.
  463.  
  464.      -q   Causes the command to be somewhat quiet.
  465.  
  466.      -l   Causes the command to not be recursive.  Only the
  467.           specified directory will be processed.
  468.  
  469.      -f   Forces the specified tag to match.  Normally, when a
  470.           tag is specified with the -r option and the RCS file
  471.           does not contain the tag, the ``head'' revision for the
  472.           RCS file is returned.  When the -f option is specified,
  473.           any RCS file that does not contain the specified tag is
  474.           ignored.  This is useful for extracting an exact copy
  475.           of a previously tagged release.
  476.  
  477.      -n   Causes the command not to run any checkout/commit/tag
  478.           program as specified in the modules database.
  479.  
  480.      -p   On checkout or update, prune directories that are empty
  481.           after being updated.  This is useful for extracting an
  482.           exact copy of a previously release, especially when
  483.           combined with the -f option.
  484.  
  485.      -r tag
  486.           Causes the command to use the revision specified by the
  487.           tag argument instead of the usual ``head'' revision.
  488.           The tag can be either a symbolic or numeric tag, in RCS
  489.           fashion, except in the case of the commit command, in
  490.           which case the tag must be a numeric one.  Specifying
  491.           the -q option along with the -r option is often useful,
  492.           to suppress the warning messages when the RCS file does
  493.           not contain the specified tag.
  494.  
  495.      -D date_spec
  496.           Causes the command to use the revision that was checked
  497.           in at or before the specified date_spec argument.  The
  498.           date_spec is a single argument, free form date descrip-
  499.           tion specifying a date in the past.  This option
  500.           implies the -f option.  See the EXAMPLES section for
  501.           useful examples of how the -D option can be used.
  502.  
  503. CONFLICT RESOLUTION
  504.      The algorithm used by checkout and update is described in
  505.      this section.  The output generated, unless the -Q option is
  506.      specified, consists of the following lines to describe
  507.      exactly how your private sources are being brought up-to-
  508.      date with the RCS source repository.
  509.  
  510.      U file
  511.           The specified file was copied directly out of its
  512.           respective RCS file from the source repository.  This
  513.           is done because the condition of your user file matches
  514.           one of the following:
  515.           +    The user file did not exist in your private
  516.                sources, whether it was because you removed it, or
  517.                because someone added it to the source repository.
  518.           +    The file did exist, but you did not change it and
  519.                a different revision was matched in the RCS file,
  520.                be it by the default ``head'' match, or via the -r
  521.                or -D options.
  522.  
  523.      M file
  524.           The specified file has been modified locally by you.
  525.           Use the diff command to see the actual changes that you
  526.           have made.
  527.  
  528.      A file
  529.           The specified file has been added to your private copy
  530.           of the sources, and will be added to the RCS source
  531.           repository when the file is committed.  This is a rem-
  532.           inder to you that the file needs to be committed.
  533.  
  534.      R file
  535.           The specified file has been removed from your private
  536.           copy of the sources, and will be removed from the RCS
  537.           source repository when the file is committed.  This is
  538.           a reminder to you that the file needs to be committed.
  539.  
  540.      C files
  541.           The specified file was modified locally by you, and
  542.           while doing the update, it was determined that a later
  543.           revision had been checked into the respective RCS file.
  544.           As a result, cvs performs an rcsmerge(l), which com-
  545.           bines the changes made to the RCS file with the changes
  546.           that you have made to your version of the file.  If
  547.           there were any lines in conflict during the merge (i.e.
  548.           the other developer changed the same line that you have
  549.           changed), then the C is displayed to show that the file
  550.           must be manually corrected.
  551.  
  552.           This merge process delimits the lines in conflict using
  553.           lines beginning with ``>>>>>>>'' and ``<<<<<<<'', so it
  554.           is easy to find the conflicts within your merged file.
  555.           Note that your original, modified file is preserved in
  556.           a backup file within the same directory that the file
  557.           existed.  The backup file has the form
  558.           ``.#file.version'', where the version is the RCS revi-
  559.           sion that your modified file was based upon.  Note that
  560.           some systems automatically purge files that begin with
  561.           .# if they have not been accessed in roughly three
  562.           days.  Thus, if you intend to keep a copy of your ori-
  563.           ginal file, I strongly suggest that it be renamed.
  564.  
  565.           If the merge process proceeded without any conflicts,
  566.           an M is displayed instead of a C.  It is still a wise
  567.           idea to diff(1) the original version before the merge,
  568.           contained in the backup file, with the merged version
  569.           to verify that the merged changes make sense with your
  570.           changes.
  571.  
  572. MODULE SUPPORT
  573.      The checkout, patch, and tag commands all accept module
  574.      names as arguments.  The module database is stored as an
  575.      ndbm(3) format database within the CVSROOT.adm directory of
  576.      your CVSROOT source repository.  The remainder of this sec-
  577.      tion considers how the checkout command operates on the
  578.      modules database.  The operations for the other commands
  579.      that use the database are similar, except that they do not
  580.      create any files or directories in your work space, as
  581.      checkout does.
  582.  
  583.      The above commands search the module database for each
  584.      module argument.  If the module database does not exist, or
  585.      if the argument does not have a matching key in the module
  586.      database, the argument is processed as follows:
  587.  
  588.      1.   The value of the CVSROOT environment variable is
  589.           prepended to the argument to form a full path name.
  590.  
  591.      2.   If the full path name does not exist, either as a
  592.           directory or as a file with an RCS ,v extension, the
  593.           argument module cannot be resolved and the command con-
  594.           tinues, processing any remaining argument modules.
  595.  
  596.      3.   If the full path name refers to a directory, the direc-
  597.           tories leading up to the directory are created, start-
  598.           ing from the current working directory, and the direc-
  599.           tory is populated with the correct files, ready for
  600.           your editing satisfaction.  If available, and the -l
  601.           option was not specified, sub-directories are created
  602.           and populated as well, until the entire directory
  603.           hierarchy of the specified module argument is recon-
  604.           structed in your work space.
  605.  
  606.      4.   If the full path name, combined with an RCS ,v suffix
  607.           exists, only that file is extracted.  The directories
  608.           leading up to where the argument module resides are
  609.           created, if necessary, and the leaf directory is popu-
  610.           lated with the single source file.
  611.  
  612.      It should be clear from reading the above algorithm that the
  613.      module database is not required to extract or process whole
  614.      directory hierarchies, or even individual files.  However,
  615.      the addition of the module database allows a high degree of
  616.      flexibility to be added to the structure or naming of pieces
  617.      of software within the CVSROOT source hierarchy.  The easi-
  618.      est way to demonstrate the usefulness of the module database
  619.      is by example.  And so, one follows:
  620.  
  621.           #
  622.           # Sample CVS Modules file
  623.           #
  624.           # Three different line formats are valid:
  625.           #    key     -a    aliases...
  626.           #    key [options] directory
  627.           #    key [options] directory files...
  628.           #
  629.           # Where "options" are composed of:
  630.           #    -i prog        Run "prog" on checkin of files
  631.           #    -o prog        Run "prog" on "checkout" of files
  632.           #    -t prog        Run "prog" on tagging of files
  633.           #
  634.  
  635.           # Convenient aliases
  636.           world          -a .
  637.  
  638.           # CVSROOT.adm support
  639.           CVSROOT   -i /usr/local/bin/mkmodules CVSROOT.adm
  640.           CVSROOT.adm    -i /usr/local/bin/mkmodules CVSROOT.adm
  641.           modules        -i /usr/local/bin/mkmodules CVSROOT.adm modules
  642.           loginfo        -i /usr/local/bin/mkmodules CVSROOT.adm loginfo
  643.  
  644.           # The "sys" entry exists only to make symbolic links after checkout
  645.           sys       -o sys/tools/make_links sys
  646.  
  647.           # Sub-directories of "bin"
  648.           awk       bin/awk
  649.           csh       bin/csh
  650.           diff      bin/diff
  651.           make      bin/make
  652.           sed       bin/sed
  653.           sh        bin/sh
  654.  
  655.           # Programs that live in "bin"
  656.           cat       bin Makefile cat.c
  657.           chgrp          bin Makefile chgrp.c
  658.           chmod          bin Makefile chmod.c
  659.           cmp       bin Makefile cmp.c
  660.           cp        bin Makefile cp.c
  661.           date      bin Makefile date.c
  662.           dd        bin Makefile dd.c
  663.  
  664.      The format of the modules file is also described in the
  665.      above example.  The -a option in the database indicates that
  666.      the key is an alias, and that the right-hand side of the
  667.      alias is to be interpreted by the command exactly as if it
  668.      had been specified as arguments on the command line for the
  669.      command.  The -o option indicates that the specified program
  670.      is to be run on checkout.  The key for the entry is passed
  671.      as the sole argument to the program.  The -i option indi-
  672.      cates that the specified program is to be run on commit.
  673.      The full pathname of the respective source repository direc-
  674.      tory is passed as the sole argument to the program.  The -t
  675.      option indicates that the specified program is to be run on
  676.      tag.  The key for the entry is passed as the sole argument
  677.      to the program.
  678.  
  679.      As an example, the command
  680.  
  681.                example% cvs checkout awk
  682.  
  683.      will create the ``awk'' directory in your current working
  684.      directory, if necessary, and populate it with the current
  685.      revisions of the files in the ``$CVSROOT/bin/awk'' direc-
  686.      tory.  The command
  687.  
  688.                example% cvs checkout date
  689.  
  690.      will create the ``date'' directory and populate with exactly
  691.      the two files ``Makefile'' and ``date.c'' from the
  692.      ``$CVSROOT/bin/awk'' directory.
  693.  
  694. VENDOR BRANCH SUPPORT
  695.      The branch support of RCS is used to provide a convenient
  696.      method of tracking the changes made to a vendor's source
  697.      distribution.  When a source distribution is received from a
  698.      vendor, the first step is to run the checkin(l) program to
  699.      place the vendor's files under CVS control.  checkin(l)
  700.      arranges that the RCS files produced from the vendor's
  701.      source distribution are initially setup to track the 1.1.1
  702.      branch of the RCS file.  When a commit is done to one of
  703.      these files, making permanent some local change, the RCS
  704.      file is changed to track the normal ``trunk'' branch, con-
  705.      tinuing the local changes to the vendor's sources.
  706.  
  707.      When a new version of the vendor's source distribution is
  708.      received, checkin is used again to add the new files to CVS.
  709.      checkin again adds the files to the (now already existing)
  710.      1.1.1 branch of the RCS file.  This time, however, checkin
  711.      issues a warning when a new version of a locally modified
  712.      file is updated by the vendor's source distribution.  It is
  713.      your responsibility to then use the join command of cvs to
  714.      merge the vendor's changes with your local changes.  See the
  715.      description of the join command above.
  716.  
  717.      The -r and -D options of the checkout and update commands
  718.      work ``as expected'' with the vendor branch support.  In
  719.      particular, the -D option to check out based on a date in
  720.      the past follows the current default branch to find a match
  721.      for the specified date.  If a match cannot be found on the
  722.      default branch, the 1.1.1 vendor branch is searched.  This
  723.      allows checking out based on a date to work regardless of
  724.      when local changes are made to the file.
  725.  
  726. LOGGING SUPPORT
  727.      When committing a change to the source repository, a confi-
  728.      gurable logging support file, loginfo, is consulted in the
  729.      $CVSROOT/CVSROOT.adm directory.  An example of the file is
  730.      as follows:
  731.  
  732.           # The "loginfo" file is used to control where "cvs commit"
  733.           # log information is sent.  The first entry on a line is a
  734.           # regular expression which is tested against the directory
  735.           # that the change is being made to, relative to the
  736.           # $CVSROOT.  If a match is found, then the remainder of the
  737.           # line is a filter program that should expect log information
  738.           # on its standard input.
  739.           #
  740.           # The filter program may use one and only one % modifier (ala
  741.           # printf).  If %s is specified in the filter program, a brief
  742.           # title is included (enclosed in single quotes) showing the
  743.           # modified file names.
  744.           #
  745.           # If the repository name does not match any of the regular
  746.           # expressions in this file, the "DEFAULT" line is used, if it
  747.           # is specified.
  748.           #
  749.           DEFAULT   /usr/local/bin/nfpipe -t %s utils.updates
  750.           ^diag          /usr/local/bin/nfpipe -t %s diag.updates
  751.           ^local         /usr/local/bin/nfpipe -t %s local.updates
  752.           ^perf          /usr/local/bin/nfpipe -t %s perf.updates
  753.           ^sys      /usr/local/bin/nfpipe -t %s kernel.updates
  754.  
  755.      In addition, ``ALL'' can be specified as a special regular
  756.      expression which always matches, but does not change the
  757.      behaviour of when the ``DEFAULT'' branch is taken.  All
  758.      matches for the regular expression are executed.  This log-
  759.      ging feature allows for multiple groups and logging programs
  760.      to share a single CVS source repository.
  761.  
  762. EXAMPLES
  763.      Using the example modules and loginfo files shown above,
  764.      this section shows some sample commands and describes their
  765.      functions.
  766.  
  767.                example% cvs checkout csh
  768.                example% cd csh
  769.                example% make
  770.  
  771.      This command retrieves the current revision of the ``csh''
  772.      sources and places them within the ``csh'' directory.  The
  773.      ``make'' command within that directory will then build the
  774.      ``csh'' executable.
  775.  
  776.                example% cvs checkout -rSunOS csh
  777.                example% cd csh
  778.                example% make
  779.  
  780.      These commands get the current SunOS revision of ``csh'' and
  781.      builds the executable.
  782.  
  783.                example% cvs checkout date
  784.                example% cd date
  785.                example% make date
  786.  
  787.      These commands checkout the current revision of the ``date''
  788.      command, along with the Makefile that is required to build
  789.      the ``date'' executable.  The ``make'' command includes the
  790.      target ``date'', since this Makefile is used to build much
  791.      more than just ``date'' by default.
  792.  
  793.                example% cvs checkout -q sys
  794.  
  795.      Gets a copy of the current kernel sources, including the
  796.      entire kernel directory hierarchy.  The -q option suppresses
  797.      the message displayed as each directory is descended.
  798.  
  799.                example% cvs checkout -p -q -f -rSunOS sys
  800.  
  801.      Gets an exact copy of the current revision SunOS kernel
  802.      sources.  The -f option forces only files that have the
  803.      ``SunOS'' tag to be retrieved, not including files locally
  804.      added to the kernel sources.  The -p option prunes empty
  805.      directories, thereby not including directories that have
  806.      been locally added to the kernel source hierarchy.
  807.  
  808.                example% cvs checkout -p -D 'August 10, 1989 14:40' sys
  809.  
  810.      The exact copy of the kernel sources as of the specified
  811.      date and time is retrieved.  The date is a free-form
  812.      strings, as specified in rcs(l).
  813.  
  814.                example% cvs diff -c
  815.                example% cvs commit -a -m 'fixed NULL pointer dereference'
  816.  
  817.      The diff command displays a context diff of all the changes
  818.      that you have made to the sources within the current direc-
  819.      tory.  Only those files thaty you have changed are
  820.      displayed.  The commit command makes these changes permanent
  821.      within the source repository so that others can benefit from
  822.      your fix.
  823.  
  824.                example% cvs diff -c -rSunOS file.c
  825.                example% cvs diff -c -r1.9 -r1.11 file.c
  826.                example% cvs diff -c -r1.22 file.c
  827.  
  828.      Examples of how the diff command can be used.  The first
  829.      example displays the differences between the SunOS version
  830.      of the file and your checked out version.  The second exam-
  831.      ple shows the differences between two specific revisions of
  832.      the RCS file.  The final example diffs the currently checked
  833.      out file against a specific revision of the RCS file.
  834.  
  835.                example% cvs tag PrismaOS1_0 csh
  836.                example% cvs tag PrismaOS1_0 bin
  837.                example% cvs tag test_kernel sys
  838.                example% cvs tag -d test_kernel sys
  839.                example% cvs tag -q -f -rSunOS SUNOS .
  840.                example% cvs tag -D 'June 30, 1989' JUNE_KERNEL sys
  841.  
  842. FILES
  843.      CVS.adm
  844.           A directory created by the checkout command within each
  845.           directory that contains checked out source files.  This
  846.           directory holds all the cvs administration files for an
  847.           individual's private copy of the sources.  In general,
  848.           these files should not be edited by hand.  cvs will do
  849.           that for you.  Be sure to never remove this directory
  850.           if you have source files that have been modified and
  851.           need to be committed in the directory that the CVS.adm
  852.           directory administrates.  The files contained in this
  853.           directory are described below.
  854.  
  855.      CVS.adm/Entries
  856.           Contains the list of files that have been checked out
  857.           in the current directory along with the revision number
  858.           that each checked out file is up-to-date with and a
  859.           timestamp that is used to quickly determine if a file
  860.           has been possibly modified or not.
  861.  
  862.      CVS.adm/Entries.Backup
  863.           A backup of the previous CVS.adm/Entries file, just in
  864.           case of catastrophe.
  865.  
  866.      CVS.adm/Entries.Static
  867.           The existence of this file tells cvs to only use the
  868.           files contained in the CVS.adm/Entries file when gen-
  869.           erating the list of source files for this directory.
  870.           This allows selected files from a directory in the
  871.           source repository to be checked out and manipulated
  872.           without requiring that the entire source directory be
  873.           used.
  874.  
  875.      CVS.adm/Mod
  876.           After doing an update command, this file reflects the
  877.           current list of modified source files for the direc-
  878.           tory.
  879.  
  880.      CVS.adm/Repository
  881.           Holds the pathname to the respective directory in the
  882.           source repository that these files refer to.  This is
  883.           usually a relative pathname, with the value of the
  884.           CVSROOT environment tacked on the front to produce a
  885.           full pathname.  If the pathname in the
  886.           CVS.adm/Repository file is already a full pathname, the
  887.           CVSROOT value is not tacked on.
  888.  
  889.      CVS.adm/Checkin.prog
  890.           Contains one line which specifies the program that is
  891.           to be run when any files in the current directory are
  892.           checked in to the source repository with the commit
  893.           command.  The particular use of this is to rebuild the
  894.           ``modules'' database after a new revision is checked in
  895.           - see mkmodules(l).
  896.  
  897.      The following files or directories are created directly in
  898.      the source repository directories as needed.
  899.  
  900.      CVSROOT.adm
  901.           A directory that should exist in the top-most directory
  902.           as defined by the CVSROOT environment variable.  This
  903.           directory contains administrations files that define
  904.           the global actions for the entire source repository
  905.           beginning at CVSROOT . The files used directly by cvs
  906.           in this directory are described below, though you are
  907.           free to add others as you see fit.
  908.  
  909.      CVSROOT.adm/modules,v
  910.           The RCS file which defines the modules supported within
  911.           this source repository.  The format is as specified in
  912.           the MODULE SUPPORT section above for more information.
  913.  
  914.      CVSROOT.adm/loginfo,v
  915.           The RCS file that contains the descriptions of which
  916.           programs to pipe log messages into when committing
  917.           files.  See the LOGGING SUPPORT section above for more
  918.           information.
  919.  
  920.      Attic
  921.           When RCS files are removed with the remove command, the
  922.           actual RCS file is moved into the Attic directory where
  923.           it will remain until someone uses the add command to
  924.           restore it as a needed source file.
  925.  
  926.      #cvs.lock
  927.           A lock directory created by cvs when doing sensitive
  928.           changes to the RCS source repository.
  929.  
  930.      #cvs.tfl.pid
  931.           A lock file created just to test the waters of the RCS
  932.           source repository directory before committing files.
  933.  
  934.      #cvs.rfl.pid
  935.           A read lock created when doing the update command.  A
  936.           commit done by some other user will wait until all
  937.           readers have finished using the directory before
  938.           proceeding.
  939.  
  940.      #cvs.wfl.pid
  941.           A write lock created by commit to cause any other
  942.           updates in the same source repository directory to
  943.           block until the commit has completed.
  944.  
  945. ENVIRONMENT VARIABLES
  946.      CVSROOT
  947.           Must be set for most commands.  Should contain the full
  948.           pathname to the root of the cvs source repository, that
  949.           is, where the RCS files are kept.
  950.  
  951.      CVSREAD
  952.           If this is set, checkout and update will try hard to
  953.           make your private checked out sources read-only.  When
  954.           this is not set, the default behaviour is to make
  955.           read-write files.
  956.  
  957.      RCSBIN
  958.           Specifies the full pathname where to find RCS programs,
  959.           such as co(l) and ci(l).  If not set, the default is
  960.           /usr/local/bin.
  961.  
  962.      EDITOR
  963.           Specifies the editor to use when doing a commit.  If
  964.           not set, the default editor used is /usr/ucb/vi.
  965.  
  966. AUTHORS
  967.      Dick Grune
  968.           Original author of the cvs shell script version posted
  969.           to comp.sources.unix in the volume6 release of
  970.           December, 1986.  Credited with much of the cvs conflict
  971.           resolution algorithms.
  972.  
  973.      Brian Berliner
  974.           Coder and designer of the cvs program itself in April,
  975.           1989, based on the original work done by Dick.
  976.  
  977.      Jeff Polk
  978.           Helped Brian with the design of the cvs module and ven-
  979.           dor branch support and author of the checkin(l) shell
  980.           script.
  981.  
  982. SEE ALSO
  983.      checkin(l), ci(l), co(l), diff(1), grep(1), mkmodules(l),
  984.      ndbm(3), patch(l), rcs(l), rcsdiff(l), rcsmerge(l), rlog(l),
  985.      rm(1), sort(1).
  986.  
  987. BUGS
  988.