Friday, February 3, 2012

CVS HOWTO

CVS checkout - load CVS repository into local repository

\> cvs co -help
co: invalid option -- h
Usage:
  cvs checkout [-ANPRcflnps] [-r rev] [-D date] [-d dir]
    [-j rev1] [-j rev2] [-k kopt] modules...
        -A      Reset any sticky tags/date/kopts.
        -N      Don't shorten module paths if -d specified.
        -P      Prune empty directories.
        -R      Process directories recursively.
        -c      "cat" the module database.
        -f      Force a head revision match if tag/date not found.
        -l      Local directory only, not recursive
        -n      Do not run module program (if any).
        -p      Check out files to standard output (avoids stickiness).
        -s      Like -c, but include module status.
        -r rev  Check out revision or tag. (implies -P) (is sticky)
        -D date Check out revisions as of date. (implies -P) (is sticky)
        -d dir  Check out into dir instead of module name.
        -k kopt Use RCS kopt -k option on checkout. (is sticky)
        -j rev  Merge in changes made between current revision and rev.
(Specify the --help global option for a list of other help options)

EXAMPLE
cvs co -d directory CVS_directory_path/directory

CVS status - view status of file from local repository

\> cvs status -help
status: invalid option -- h
Usage: cvs status [-vlR] [files...]
        -v      Verbose format; includes tag information for the file
        -l      Process this directory only (not recursive).
        -R      Process directories recursively.
(Specify the --help global option for a list of other help options)

EXAMPLE
\> cvs status -v config.ksh
===================================================================
File: file_name        Status: Up-to-date

   Working revision:    1.6
   Repository revision: 1.6     CVS_directory_path/file_name,v
   Commit Identifier:   3K1Ow4Mss3EvmGRv
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)

   Existing Tags:
        TAG_34                         (revision: 1.4)
        TAG_33                         (revision: 1.4)
        TAG_30                         (revision: 1.2)
        TAG_29                         (revision: 1.2) ...

CVS diff - view differences between files from CVS repository and files from local repository

\> cvs diff --help
diff: unrecognized option `--help'
Usage: cvs diff [-lR] [-k kopt] [format_options]
    [[-r rev1 | -D date1] [-r rev2 | -D date2]] [files...]
        -l      Local directory only, not recursive
        -R      Process directories recursively.
        -k kopt Specify keyword expansion mode.
        -D d1   Diff revision for date against working file.
        -D d2   Diff rev1/date1 against date2.
        -r rev1 Diff revision for rev1 against working file.
        -r rev2 Diff rev1/date1 against rev2.

format_options:
  -i  --ignore-case  Consider upper- and lower-case to be the same.
  -w  --ignore-all-space  Ignore all white space.
  -b  --ignore-space-change  Ignore changes in the amount of white space.
  -B  --ignore-blank-lines  Ignore changes whose lines are all blank.
  -I RE  --ignore-matching-lines=RE  Ignore changes whose lines all match RE.
  --binary  Read and write data in binary mode.
  -a  --text  Treat all files as text.

  -c  -C NUM  --context[=NUM]  Output NUM (default 2) lines of copied context.
  -u  -U NUM  --unified[=NUM]  Output NUM (default 2) lines of unified context.
    -NUM  Use NUM context lines.
    -L LABEL  --label LABEL  Use LABEL instead of file name.
    -p  --show-c-function  Show which C function each change is in.
    -F RE  --show-function-line=RE  Show the most recent line matching RE.
  --brief  Output only whether files differ.
  -e  --ed  Output an ed script.
  -f  --forward-ed  Output something like an ed script in forward order.
  -n  --rcs  Output an RCS format diff.
  -y  --side-by-side  Output in two columns.
    -W NUM  --width=NUM  Output at most NUM (default 130) characters per line.
    --left-column  Output only the left column of common lines.
    --suppress-common-lines  Do not output common lines.
  --ifdef=NAME  Output merged file to show `#ifdef NAME' diffs.
  --GTYPE-group-format=GFMT  Similar, but format GTYPE input groups with GFMT.
  --line-format=LFMT  Similar, but format all input lines with LFMT.
  --LTYPE-line-format=LFMT  Similar, but format LTYPE input lines with LFMT.
    LTYPE is `old', `new', or `unchanged'.  GTYPE is LTYPE or `changed'.
    GFMT may contain:
      %<  lines from FILE1
      %>  lines from FILE2
      %=  lines common to FILE1 and FILE2
      %[-][WIDTH][.[PREC]]{doxX}LETTER  printf-style spec for LETTER
        LETTERs are as follows for new group, lower case for old group:
          F  first line number
          L  last line number
          N  number of lines = L-F+1
          E  F-1
          M  L+1
    LFMT may contain:
      %L  contents of line
      %l  contents of line, excluding any trailing newline
      %[-][WIDTH][.[PREC]]{doxX}n  printf-style spec for input line number
    Either GFMT or LFMT may contain:
      %%  %
      %c'C'  the single character C
      %c'\OOO'  the character with octal code OOO

  -t  --expand-tabs  Expand tabs to spaces in output.
  -T  --initial-tab  Make tabs line up by prepending a tab.

  -N  --new-file  Treat absent files as empty.
  -s  --report-identical-files  Report when two files are the same.
  --horizon-lines=NUM  Keep NUM lines of the common prefix and suffix.
  -d  --minimal  Try hard to find a smaller set of changes.
  -H  --speed-large-files  Assume large files and many scattered small changes.

(Specify the --help global option for a list of other help options)

EXAMPLE:
 \> cvs diff -r TAG_34 file_name
Index: file_name
===================================================================
RCS file: CVS_directory_path/file_name,v
retrieving revision 1.4
retrieving revision 1.6
diff -r1.4 -r1.6

When no file_name is specified, returns status for all files in current directory.

CVS COMMIT - commits into CVS repository modifications from local repository

\> cvs commit --help
commit: invalid option -- -
Usage: cvs commit [-Rlf] [-m msg | -F logfile] [-r rev] files...
    -R          Process directories recursively.
    -l          Local directory only (not recursive).
    -f          Force the file to be committed; disables recursion.
    -F logfile  Read the log message from file.
    -m msg      Log message.
    -r rev      Commit to this branch or trunk revision.
(Specify the --help global option for a list of other help options)

EXAMPLE:
cvs commit -m "Commit message" file_name

When file_name is not specified, all files in current directory are commited !!!!!

CVS LOG - returns CVS log modifications for file_name


\> cvs log --help

log: invalid option -- -
Usage: cvs log [-lRhtNb] [-r[revisions]] [-d dates] [-s states]
    [-w[logins]] [files...]
        -l      Local directory only, no recursion.
        -b      Only list revisions on the default branch.
        -h      Only print header.
        -R      Only print name of RCS file.
        -t      Only print header and descriptive text.
        -N      Do not list tags.
        -S      Do not print name/header if no revisions selected.  -d, -r,
                -s, & -w have little effect in conjunction with -b, -h, -R, and
                -t without this option.
        -r[revisions]   A comma-separated list of revisions to print:
           rev1:rev2   Between rev1 and rev2, including rev1 and rev2.
           rev1::rev2  Between rev1 and rev2, excluding rev1.
           rev:        rev and following revisions on the same branch.
           rev::       After rev on the same branch.
           :rev        rev and previous revisions on the same branch.
           ::rev       rev and previous revisions on the same branch.
           rev         Just rev.
           branch      All revisions on the branch.
           branch.     The last revision on the branch.
        -d dates        A semicolon-separated list of dates
                        (D1<D2 for range, D for latest before).
        -s states       Only list revisions with specified states.
        -w[logins]      Only list revisions checked in by specified logins.
(Specify the --help global option for a list of other help options)

EXAMPLE:
\> cvs log file_name

RCS file: CVS_directory_path/file_name,v
Working file: file_name
head: 1.6
branch:
locks: strict
access list:
symbolic names:
        TAG_34: 1.4
        TAG_33: 1.4
        TAG_30: 1.2
  .......
keyword substitution: kv
total revisions: 6;     selected revisions: 6
description:
----------------------------
revision 1.6
date: 2009-02-03 07:32:51 +0000;  author: roto1;  state: Exp;  lines: +4 -6;  commitid: 3K1Ow4Mss3EvmGRv;
Commit message
----------------------------
........

CVS REMOVE - removes a file from CVS repository


 \> cvs remove --help

remove: invalid option -- -
Usage: cvs remove [-flR] [files...]
        -f      Delete the file before removing it.
        -l      Process this directory only (not recursive).
        -R      Process directories recursively.
(Specify the --help global option for a list of other help options)


EXAMPLE:

-- remove files from local repository
\> rm file_name
-- instruct CVS to remove file from CVS repository
\> cvs remove file_name
-- commit into CVS repository file removal
cvs commit -m "remove message" file_name
-- cveck status
 \> cvs status file_name
===================================================================
File: no file file_name              Status: Up-to-date

   Working revision:    No entry for file_name
   Repository revision: 1.2     CVS_directory_path/Attic/file_name,v
   Commit Identifier:   JkdcT2aU3OHDyBRv

CVS ADD - add files to CVS repository


\> cvs add --help

add: invalid option -- -
Usage: cvs add [-k rcs-kflag] [-m message] files...
        -k      Use "rcs-kflag" to add the file with the specified kflag.
        -m      Use "message" for the creation log.
(Specify the --help global option for a list of other help options)

EXAMPLE:

$ mkdir -p foo/bar
$ cp ~/myfile foo/bar/myfile
-- files must exist before CVS add
$ cvs add foo foo/bar
$ cvs add foo/bar/myfile
-- use CVS commit to commit into CVS repository
$ cvs commit -m "Early version." myfile

CVS UPDATE - updates local repository with versions from CVS repository



 \> cvs update --help
update: invalid option -- -
Usage: cvs update [-APCdflRp] [-k kopt] [-r rev] [-D date] [-j rev]
    [-I ign] [-W spec] [files...]
        -A      Reset any sticky tags/date/kopts.
        -P      Prune empty directories.
        -C      Overwrite locally modified files with clean repository copies.
        -d      Build directories, like checkout does.
        -f      Force a head revision match if tag/date not found.
        -l      Local directory only, no recursion.
        -R      Process directories recursively.
        -p      Send updates to standard output (avoids stickiness).
        -k kopt Use RCS kopt -k option on checkout. (is sticky)
        -r rev  Update using specified revision/tag (is sticky).
        -D date Set date to update from (is sticky).
        -j rev  Merge in changes made between current revision and rev.
        -I ign  More files to ignore (! to reset).
        -W spec Wrappers specification line.
(Specify the --help global option for a list of other help options)

EXAMPLE:


/> cvs update file_name
-- cvs update merge between versions
/> cvs update -j TAG_34 -j TAG_30 file_name


CVS will continue ...

No comments:

Post a Comment