[BACK]Return to rcs.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / rcs

Annotation of src/usr.bin/rcs/rcs.1, Revision 1.48

1.48    ! niallo      1: .\"    $OpenBSD: rcs.1,v 1.47 2006/12/27 07:44:27 niallo Exp $
1.1       deraadt     2: .\"
                      3: .\" Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
1.22      jmc         4: .\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
1.1       deraadt     5: .\" All rights reserved.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms, with or without
                      8: .\" modification, are permitted provided that the following conditions
                      9: .\" are met:
                     10: .\"
                     11: .\" 1. Redistributions of source code must retain the above copyright
                     12: .\"    notice, this list of conditions and the following disclaimer.
                     13: .\" 2. The name of the author may not be used to endorse or promote products
                     14: .\"    derived from this software without specific prior written permission.
                     15: .\"
                     16: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
                     17: .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
                     18: .\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
                     19: .\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
                     20: .\" EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
                     21: .\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
                     22: .\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
                     23: .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
                     24: .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
                     25: .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     26: .\"
                     27: .Dd May 16, 2004
                     28: .Dt RCS 1
                     29: .Os
                     30: .Sh NAME
                     31: .Nm rcs
                     32: .Nd RCS file management program
                     33: .Sh SYNOPSIS
                     34: .Nm
1.47      niallo     35: .Op Fl IiLqTUV
1.14      xsa        36: .Op Fl A Ns Ar oldfile
1.7       niallo     37: .Op Fl a Ns Ar users
                     38: .Op Fl b Ns Op Ar rev
1.12      xsa        39: .Op Fl c Ns Ar string
1.7       niallo     40: .Op Fl e Ns Op Ar users
1.9       xsa        41: .Op Fl k Ns Ar mode
1.24      ray        42: .Op Fl l Ns Op Ar rev
1.33      jmc        43: .Oo Fl m Ns Ar rev :
1.20      xsa        44: .Ar msg Oc
1.19      xsa        45: .Op Fl o Ns Ar rev
1.43      ray        46: .Op Fl t Ns Ar str
1.24      ray        47: .Op Fl u Ns Op Ar rev
1.15      xsa        48: .Op Fl x Ns Ar suffixes
1.30      jmc        49: .Ar
1.1       deraadt    50: .Sh DESCRIPTION
1.22      jmc        51: Revision Control System (RCS) is a software tool which lets people
                     52: manage multiple revisions of text that is revised frequently, such as
                     53: source code or documentation.
                     54: .Pp
1.1       deraadt    55: The
                     56: .Nm
                     57: program is used to create RCS files or manipulate the contents of existing
                     58: files.
1.22      jmc        59: A set of helper tools is also available:
                     60: specific revisions of files may be checked in or out, using
                     61: .Xr ci 1
                     62: and
                     63: .Xr co 1 ;
                     64: differences between revisions viewed or merged, using
                     65: .Xr rcsdiff 1
                     66: and
                     67: .Xr rcsmerge 1 ;
                     68: and information about RCS files and keyword strings displayed using
                     69: .Xr rlog 1
                     70: and
                     71: .Xr ident 1 .
                     72: See the respective manual pages for more information
                     73: about these utilities.
1.1       deraadt    74: .Pp
                     75: The following options are supported:
                     76: .Bl -tag -width "-e usersXX"
1.14      xsa        77: .It Fl A Ns Ar oldfile
                     78: Append the access list of
                     79: .Ar oldfile
                     80: to the access list of the RCS files.
1.7       niallo     81: .It Fl a Ns Ar users
1.1       deraadt    82: Add the usernames specified in the comma-separated list
                     83: .Ar users
                     84: to the access list of the RCS files.
1.7       niallo     85: .It Fl b Ns Op Ar rev
1.45      jmc        86: Set the default branch (see below) to
1.14      xsa        87: .Ar rev .
1.45      jmc        88: If no argument is specified,
                     89: the default branch is set to the highest numbered branch.
1.12      xsa        90: .It Fl c Ns Ar string
                     91: Set comment leader to
                     92: .Ar string .
1.41      jmc        93: The comment leader specifies the comment character(s) for a file.
                     94: This option is useful for compatibility with older RCS implementations
                     95: only.
1.7       niallo     96: .It Fl e Ns Op Ar users
1.1       deraadt    97: Remove the usernames specified in the comma-separated list
                     98: .Ar users
                     99: from the access list of the RCS files.
                    100: If
                    101: .Ar users
                    102: is not specified, all users are removed from the access list.
1.20      xsa       103: .It Fl I
                    104: Interactive mode.
1.1       deraadt   105: .It Fl i
1.10      xsa       106: Create and initialize a new RCS file.
1.11      jmc       107: If the RCS file has no path prefix, try to first create it in the
1.10      xsa       108: .Pa ./RCS
1.11      jmc       109: subdirectory or, if that fails, in the current directory.
1.1       deraadt   110: Files created this way contain no revision.
1.9       xsa       111: .It Fl k Ns Ar mode
1.44      jmc       112: Specify the keyword substitution mode (see below).
1.1       deraadt   113: .It Fl L
                    114: Enable strict locking on the RCS files.
1.24      ray       115: .It Fl l Ns Op Ar rev
                    116: Lock revision
                    117: .Ar rev
                    118: on the RCS files.
1.7       niallo    119: .It Fl m Ns Ar rev : Ns Ar msg
1.5       jmc       120: Replace revision
                    121: .Ar rev Ns 's
                    122: log message with
                    123: .Ar msg .
1.19      xsa       124: .It Fl o Ns Ar rev
                    125: Delete one or more revisions.
                    126: The specifications of the values or revisions are as follows:
                    127: .Bl -tag -width Ds
                    128: .It rev
                    129: Specific revision.
                    130: .It rev1:rev2
                    131: Delete all revisions of a branch between
                    132: .Ar rev1
                    133: and
                    134: .Ar rev2 .
                    135: .It rev1::rev2
                    136: Delete all revisions of a branch between
                    137: .Ar rev1
                    138: and
                    139: .Ar rev2
                    140: without deleting revisions
                    141: .Ar rev1
                    142: and
                    143: .Ar rev2 .
                    144: .It :rev
                    145: Delete all revisions of the branch until revision
                    146: .Ar rev .
                    147: .It rev:
                    148: Delete all revisions of the branch from revision
                    149: .Ar rev
                    150: until the last revision of the branch.
                    151: .El
1.13      xsa       152: .It Fl q
                    153: Be quiet about reporting.
1.20      xsa       154: .Ar rev
                    155: to the identifier
1.44      jmc       156: .Ar state
                    157: (see below).
1.20      xsa       158: The specified value may not contain a space character.
1.16      xsa       159: .It Fl T
1.17      jmc       160: Preserve the modification time of RCS files.
1.43      ray       161: .It Fl t Ns Ar str
1.14      xsa       162: Change the descriptive text.
1.43      ray       163: The argument
1.14      xsa       164: .Ar str
1.43      ray       165: is interpreted as the name of a file containing
                    166: the descriptive text or,
                    167: if prefixed with a
                    168: .Sq - ,
                    169: the actual descriptive text itself.
1.14      xsa       170: If no argument is used, the descriptive text is taken from standard input
                    171: terminated by end-of-file or by a line containing the
                    172: .Sq \&.
                    173: character by itself.
1.1       deraadt   174: .It Fl U
                    175: Disable strict locking on the RCS files.
1.24      ray       176: .It Fl u Ns Op Ar rev
                    177: Unlock revision
                    178: .Ar rev
                    179: on the RCS files.
1.1       deraadt   180: .It Fl V
                    181: Print the program's version string and exit.
1.15      xsa       182: .It Fl x Ns Ar suffixes
                    183: Specifies the suffixes for RCS files.
                    184: Suffixes should be separated by the
                    185: .Sq /
                    186: character.
1.25      jmc       187: .El
1.46      xsa       188: .Pp
                    189: .Ex -std rcs
1.44      jmc       190: .Sh BRANCHES AND REVISIONS
                    191: Files may be selected by
                    192: .Em revision
                    193: or, where no revision is specified,
                    194: the latest revision of the default
                    195: .Em branch
                    196: is used.
                    197: Revisions are specified either by using the
                    198: .Fl r
                    199: option or
                    200: by appending the revision number to any option that supports it.
                    201: Branches are selected using the
                    202: .Fl b
                    203: option.
                    204: .Pp
                    205: A file's revision consists of two elements:
                    206: release number and level number.
                    207: For example, revision 2.3 of a file denotes release 2, level 3.
                    208: Levels may also be subdivided into sublevels:
                    209: this might happen, for example,
                    210: if a parallel development is forked from a lower level revision.
                    211: The primary levels and the sublevels belong to separate branches:
                    212: the primary levels belong to a branch called HEAD,
                    213: while sublevels belong to branches specified by revision.
                    214: .Pp
                    215: .Nm
                    216: also supports the notion of
                    217: .Em state .
                    218: The state is an arbitrary string of characters used to describe a file
                    219: (or a specific revision of a file).
                    220: States can be set or changed using the
                    221: .Fl s
                    222: option, for RCS tools which support it.
                    223: The state of a file/revision can be modified without having to check in
                    224: a new file/revision.
                    225: The default state is
                    226: .Sq Exp
                    227: (Experimental).
                    228: Examples of states could be
                    229: .Sq Dev ,
                    230: .Sq Reviewed ,
                    231: or
                    232: .Sq Stab .
                    233: .Pp
                    234: In order to make large groups of RCS files more manageable,
                    235: RCS tools have the ability to select files by their
                    236: .Em symbolic name .
                    237: Thus files can be selected by their symbolic name,
                    238: rather than numerical revision.
                    239: .Xr ci 1
                    240: .Fl N
                    241: and
                    242: .Fl n
                    243: are used to set symbolic names for files.
                    244: .Pp
                    245: The following methods of file selection are therefore available:
                    246: revision number, state, and symbolic name.
                    247: For options which take as argument
                    248: .Ar rev
                    249: or
                    250: .Ar state ,
                    251: any of these methods may be used.
                    252: Some examples:
                    253: .Bd -literal -offset indent
                    254: $ co -r"myproject" foo.c
                    255: $ rcs -m1.3:update foo.c
                    256: $ ci -s"Exp" bar.c
                    257: .Ed
1.25      jmc       258: .Sh KEYWORD SUBSTITUTION
1.40      jmc       259: As long as source files are edited inside a working directory,
                    260: their state can be determined using the
1.27      jmc       261: .Xr cvs 1
1.25      jmc       262: .Ic status
                    263: or
                    264: .Ic log
                    265: commands, but as soon as files get exported from
1.40      jmc       266: a local working copy, it becomes harder to identify which
1.25      jmc       267: revisions they are.
                    268: .Pp
                    269: .Nm
                    270: and
                    271: .Xr cvs 1
1.40      jmc       272: use a mechanism known as
1.25      jmc       273: .Sq keyword substitution
                    274: to help identify the files.
                    275: Embedded strings of the form $keyword$ and $keyword:...$ in a file
1.40      jmc       276: are replaced with strings of the form $keyword: value$ whenever
                    277: a new revision of the file is obtained.
1.25      jmc       278: The possible keywords are as follows:
1.30      jmc       279: .Bl -tag -width "XrevisionXX" -offset "XXX"
1.25      jmc       280: .It $\&Author$
                    281: The name of the user who checked in the revision.
                    282: .It $\&Date$
                    283: The date and hour (UTC) the revision was checked in.
                    284: .It $\&Header$
                    285: Standard header containing the full pathname of the RCS
                    286: file, the revision number, the date (UTC), the author and the state.
                    287: .It $\&Id$
                    288: The same content as $\&Header$ but without the path
                    289: of the RCS file.
                    290: .It $\&Log$
                    291: The log message supplied during commit, preceded by a header
                    292: containing the RCS filename, the revision number, the
                    293: author, and the date (UTC).
                    294: .It $\&Name$
                    295: The tag name used to check out the file.
                    296: .It $\&RCSfile$
                    297: The name of the RCS file, but without a path.
                    298: .It $\&Revision$
                    299: The revision number assigned to the revision.
                    300: .It $\&Source$
                    301: The full pathname of the RCS file.
                    302: .It $\&State$
                    303: The state assigned to the revision.
                    304: .El
                    305: .Pp
                    306: Keyword substitution has its disadvantages: sometimes the
                    307: literal text string $\&Author$ is wanted inside a file without
                    308: .Nm
1.27      jmc       309: or
                    310: .Xr cvs 1
1.25      jmc       311: interpreting it as a keyword and expanding it into something like
                    312: $\&Author$.
                    313: The
1.26      jmc       314: .Fl k Ns Ar o
1.25      jmc       315: option can be used to turn off keyword substitution entirely though.
                    316: There is unfortunately no way to selectively turn off keyword substitution.
                    317: .Pp
                    318: Each file and working directory copy of a file have a stored
                    319: default substitution mode.
                    320: Substitution modes on files are set by the
                    321: .Fl k Ns Ar mode
                    322: option.
                    323: .Pp
                    324: The possible substitution modes are as follows:
                    325: .Bl -tag -width Ds -offset 3n
1.26      jmc       326: .It Fl k Ns Ar b
1.25      jmc       327: Like
1.26      jmc       328: .Fl k Ns Ar o ,
1.25      jmc       329: but also avoids the conversion of line endings.
                    330: This option is used to handle binary files.
1.26      jmc       331: .It Fl k Ns Ar k
1.25      jmc       332: Does not substitute the keywords.
                    333: Useful with the
1.27      jmc       334: .Xr cvs 1
1.25      jmc       335: .Ic diff
1.28      jmc       336: and
                    337: .Xr rcsdiff 1
                    338: commands to avoid displaying the differences between keyword substitutions.
1.26      jmc       339: .It Fl k Ns Ar kv
1.25      jmc       340: The default behaviour.
                    341: Keywords are normally substituted i.e. $\&Revision$ becomes
                    342: $\&Revision: 1.1 $.
1.26      jmc       343: .It Fl k Ns Ar kvl
1.25      jmc       344: Like
1.26      jmc       345: .Fl k Ns Ar kv ,
1.25      jmc       346: except that the locker's name is displayed along with the version
                    347: if the given revision is currently locked.
                    348: This option is normally not useful as
                    349: .Nm
1.27      jmc       350: and
                    351: .Xr cvs 1
                    352: do not use file locking by default.
1.26      jmc       353: .It Fl k Ns Ar o
1.25      jmc       354: No substitutions are done.
                    355: This option is often used with the
1.27      jmc       356: .Xr cvs 1
1.25      jmc       357: .Ic import
                    358: command to guarantee that files that already contain external keywords
                    359: do not get modified.
1.26      jmc       360: .It Fl k Ns Ar v
1.25      jmc       361: Substitute the value of keywords instead of keywords themselves
                    362: e.g. instead of $\&Revision$, only insert 1.1 and not $\&Revision: 1.1 $.
                    363: This option must be used with care, as it can only be used once.
                    364: It is often used with the
1.27      jmc       365: .Xr cvs 1
1.25      jmc       366: .Ic export
                    367: command to freeze the values before releasing software.
1.1       deraadt   368: .El
                    369: .Sh ENVIRONMENT
                    370: .Bl -tag -width RCSINIT
                    371: .It Ev RCSINIT
                    372: If set, this variable should contain a list of space-delimited options that
                    373: are prepended to the argument list.
                    374: .El
1.22      jmc       375: .Sh EXAMPLES
                    376: One of the most common uses of
                    377: .Nm
                    378: is to track changes to a document containing source code.
                    379: .Pp
                    380: As an example,
                    381: we'll look at a user wishing to track source changes to a file
                    382: .Ar foo.c .
                    383: .Pp
                    384: If the
                    385: .Ar RCS
                    386: directory does not exist yet, create it as follows and invoke the
                    387: check-in command:
                    388: .Bd -literal -offset indent
                    389: $ mkdir RCS
                    390: $ ci foo.c
                    391: .Ed
                    392: .Pp
                    393: This command creates an RCS file
                    394: .Ar foo.c,v
                    395: in the
                    396: .Ar RCS
                    397: directory, stores
                    398: .Ar foo.c
                    399: into it as revision 1.1, and deletes
                    400: .Ar foo.c .
                    401: .Xr ci 1
                    402: will prompt for a description of the file to be entered.
                    403: Whenever a newly created (or updated) file is checked-in,
                    404: .Xr ci 1
                    405: will prompt for a log message to be entered which should summarize
                    406: the changes made to the file.
                    407: That log message will be added to the RCS file along with the new revision.
                    408: .Pp
                    409: The
                    410: .Xr co 1
                    411: command can now be used to obtain a copy of the checked-in
                    412: .Ar foo.c,v
                    413: file:
                    414: .Pp
                    415: .Dl $ co foo.c
                    416: .Pp
1.36      jmc       417: This command checks the file out in unlocked mode.
1.22      jmc       418: If a user wants to have exclusive access to the file to make changes to it,
                    419: it needs to be checked out in locked mode using the
                    420: .Fl l
                    421: option of the
                    422: .Xr co 1
                    423: command.
                    424: Only one concurrent locked checkout of a revision is permitted.
                    425: .Pp
                    426: Once changes have been made to the
                    427: .Pa foo.c
                    428: file, and before checking the file in, the
                    429: .Xr rcsdiff 1
                    430: command can be used to view changes between the working file
                    431: and the most recently checked-in revision:
                    432: .Pp
                    433: .Dl $ rcsdiff -u foo.c
                    434: .Pp
                    435: The
                    436: .Fl u
                    437: option produces a unified diff.
                    438: See
                    439: .Xr diff 1
                    440: for more information.
1.1       deraadt   441: .Sh SEE ALSO
                    442: .Xr ci 1 ,
                    443: .Xr co 1 ,
1.3       jmc       444: .Xr ident 1 ,
1.1       deraadt   445: .Xr rcsclean 1 ,
                    446: .Xr rcsdiff 1 ,
1.8       xsa       447: .Xr rcsmerge 1 ,
1.6       xsa       448: .Xr rlog 1
1.21      jmc       449: .Sh STANDARDS
1.31      jmc       450: OpenRCS is compatible with
                    451: Walter Tichy's original RCS implementation.
                    452: .Pp
1.37      jmc       453: The flags
                    454: .Op Fl Mz
                    455: have no effect and are provided
1.21      jmc       456: for compatibility only.
1.32      jmc       457: .Sh HISTORY
                    458: The OpenRCS project is a BSD-licensed rewrite of the original
                    459: Revision Control System.
                    460: OpenRCS is written by Jean-Francois Brousseau, Joris Vink,
                    461: Niall O'Higgins, and Xavier Santolaria.
1.35      jmc       462: .Pp
1.32      jmc       463: The original RCS code was written in large parts by Walter F. Tichy
                    464: and Paul Eggert.
1.29      jmc       465: .Sh CAVEATS
                    466: For historical reasons,
                    467: the RCS tools do not permit whitespace between options and their arguments.