diff --git a/gnu/usr.bin/rcs/CREDITS b/gnu/usr.bin/rcs/CREDITS new file mode 100644 index 00000000000..6eca1b9c68b --- /dev/null +++ b/gnu/usr.bin/rcs/CREDITS @@ -0,0 +1,24 @@ +RCS was designed and built by Walter F. Tichy of Purdue University. +RCS version 3 was released in 1983. + +Adam Hammer, Thomas Narten, and Daniel Trinkle of Purdue supported RCS through +version 4.3, released in 1990. Guy Harris of Sun contributed many porting +fixes. Paul Eggert of System Development Corporation contributed bug fixes +and tuneups. Jay Lepreau contributed 4.3BSD support. + +Paul Eggert of Twin Sun wrote the changes for RCS versions 5.5 and 5.6 (1991). +Rich Braun of Kronos and Andy Glew of Intel contributed ideas for new options. +Bill Hahn of Stratus contributed ideas for setuid support. +Ideas for piece tables came from Joe Berkovitz of Stratus and Walter F. Tichy. +Matt Cross of Stratus contributed test case ideas. +Adam Hammer of Purdue QAed. + +Paul Eggert wrote most of the changes for this version of RCS, +currently in beta test. K. Richard Pixley of Cygnus Support +contributed several bug fixes. Robert Lupton of Princeton +and Daniel Trinkle contributed ideas for $Name expansion. +Brendan Kehoe of Cygnus Support suggested rlog's -N option. +Paul D. Smith of Data General suggested improvements in option +and error processing. Adam Hammer of Purdue QAed. + +$Id: CREDITS,v 1.1 1993/11/03 17:50:39 eggert Exp $ diff --git a/gnu/usr.bin/rcs/NEWS b/gnu/usr.bin/rcs/NEWS new file mode 100644 index 00000000000..62b7c2b0b81 --- /dev/null +++ b/gnu/usr.bin/rcs/NEWS @@ -0,0 +1,548 @@ +Recent changes to RCS (and possible future changes) + + $Id: NEWS,v 1.5 1995/06/16 06:19:24 eggert Exp $ + + Copyright 1991, 1992, 1993, 1994, 1995 Paul Eggert + Distributed under license by the Free Software Foundation, Inc. + + This file is part of RCS. + + RCS is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + RCS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with RCS; see the file COPYING. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Report problems and direct all questions to: + + rcs-bugs@cs.purdue.edu + + +Here is a brief summary of user-visible changes since 5.6. + + New options: + `-kb' supports binary files. + `-T' preserves the modification time of RCS files. + `-V' prints the version number. + `-zLT' causes RCS to use local time in working files and logs. + `rcsclean -n' outputs what rcsclean would do, without actually doing it. + `rlog -N' omits symbolic names. + There is a new keyword `Name'. + Inserted log lines now have the same prefix as the preceding `$Log' line. + +Most changes for RCS version 5.7 are to fix bugs and improve portability. +RCS now conforms to GNU configuration standards and to Posix 1003.1b-1993. + + +Features new to RCS version 5.7, and possibly incompatible +in minor ways with previous practice, include: + + Inserted log lines now have the same prefix as the preceding `$Log' line. + E.g. if a $Log line starts with `// $Log', log lines are prefixed with `// '. + RCS still records the (now obsolescent) comment leader inside RCS files, + but it ignores the comment leader unless it is emulating older RCS versions. + If you plan to access a file with both old and new versions of RCS, + make sure its comment leader matches its `$Log' line prefix. + For backwards compatibility with older versions of RCS, + if the log prefix is `/*' or `(*' surrounded by optional white space, + inserted log lines contain ` *' instead of `/*' or `(*'; + however, this usage is obsolescent and should not be relied on. + + $Log string `Revision' times now use the same format as other times. + + Log lines are now inserted even if -kk is specified; this simplifies merging. + + ci's -rR option (with a nonempty R) now just specifies a revision number R. + In some beta versions, it also reestablished the default behavior of + releasing a lock and removing the working file. + Now, only the bare -r option does this. + + With an empty extension, any appearance of a directory named `RCS' + in a pathname identifies the pathname as being that of an RCS file. + For example, `a/RCS/b/c' is now an RCS file with an empty extension. + Formerly, `RCS' had to be the last directory in the pathname. + + rlog's -d option by default now uses exclusive time ranges. + E.g. `rlog -d" + + for software engineering; e.g. see + . + + + + for configuration management + + + + for CVS (see below) + + +RCS and related GNU project software + + + The RCS project distribution directory also contains beta versions, + ports, and prebuilt documentation. + + + The GNU project distribution directory contains: + diffutils-N-tar.gz + the latest diffutils release; recommended for RCS + emacs-N-tar.gz + The latest Emacs release contains VC, a version-control package + that makes RCS easier to use. + make-N-tar.gz + GNU Make, which can automatically build from RCS files. + rcs-N-tar.gz + the latest RCS release + cvs-N-tar.gz + the latest official CVS release (see below) + + DOS, OS/2 ports + NT port + + +CVS + +CVS, the Concurrent Versions System, keeps tracks of source changes +made by groups of developers working on the same files concurrently, +allowing them to resync as needed. + + + + These pages have useful information about CVS. + + + CVS 1.3 is the latest released version. + + + CVS 1.4 is in alpha test, but it is recommended if you are installing CVS + for the first time, or on a recent operating system. + + DOS, OS/2 ports + NT port + + + Cyclic CVS adds network transparency to CVS; it supports efficient, + reliable, and authenticated repository access via TCP/IP. + + +Other software that uses RCS + + + Aegis manages revisions, baselines, mandatory reviews, and mandatory testing. + + + BCS, the Baseline Configuration System, + manages revisions, baselines, and staging areas. + + + ODE, the Open Software Foundation Development Environment, + manages revisions, builds, and sandboxes. + OSF uses it for their own development. + + + Odin, a `make' replacement, can build directly from arbitrary revisions + without requiring checkouts of working copies. It also handles + parallel builds on multiple remote hosts and of multiple variants. diff --git a/gnu/usr.bin/rcs/ci/ci.1 b/gnu/usr.bin/rcs/ci/ci.1 index 5736dc95a00..d096096b621 100644 --- a/gnu/usr.bin/rcs/ci/ci.1 +++ b/gnu/usr.bin/rcs/ci/ci.1 @@ -2,8 +2,10 @@ .ds Rv \\$3 .ds Dt \\$4 .. -.Id $Id: ci.1,v 5.9 1991/10/07 17:32:46 eggert Exp $ +.Id $Id: ci.1,v 5.17 1995/06/16 06:19:24 eggert Exp $ +.ds i \&\s-1ISO\s0 .ds r \&\s-1RCS\s0 +.ds u \&\s-1UTC\s0 .if n .ds - \%-- .if t .ds - \(em .TH CI 1 \*(Dt GNU @@ -41,7 +43,7 @@ new branch can be created. This restriction is not enforced for the owner of the file if non-strict locking is used (see .BR rcs (1)). -A lock held by someone else may be broken with the +A lock held by someone else can be broken with the .B rcs command. .PP @@ -105,7 +107,9 @@ The number .I rev of the deposited revision can be given by any of the options .BR \-f , +.BR \-i , .BR \-I , +.BR \-j , .BR \-k , .BR \-l , .BR \-M , @@ -114,7 +118,15 @@ of the deposited revision can be given by any of the options or .BR \-u . .I rev -may be symbolic, numeric, or mixed. +can be symbolic, numeric, or mixed. +Symbolic names in +.I rev +must already be defined; +see the +.B \-n +and +.B \-N +options for assigning names during checkin. If .I rev is @@ -124,6 +136,15 @@ determines the revision number from keyword values in the working file. .PP If .I rev +begins with a period, +then the default branch (normally the trunk) is prepended to it. +If +.I rev +is a branch number followed by a period, +then the latest revision on that branch is used. +.PP +If +.I rev is a revision number, it must be higher than the latest one on the branch to which .I rev @@ -172,25 +193,28 @@ Exception: On the trunk, revisions can be appended to the end, but not inserted. .SH OPTIONS .TP -.BR \-r [\f2rev\fP] -checks in a revision, releases the corresponding lock, and -removes the working file. This is the default. -.RS -.PP -The +.BI \-r rev +Check in revision +.IR rev . +.TP +.BR \-r +The bare .B \-r -option has an unusual meaning in +option (without any revision) has an unusual meaning in .BR ci . -In other \*r commands, +With other \*r commands, a bare .B \-r -merely specifies a revision number, -but in -.B ci -it also releases a lock and removes the working file. -See +option specifies the most recent revision on the default branch, +but with +.BR ci , +a bare +.B \-r +option reestablishes the default behavior of releasing a lock and +removing the working file, and is used to override any default +.B \-l +or .B \-u -for a tricky example. -.RE +options established by shell aliases or scripts. .TP .BR \-l [\f2rev\fP] works like @@ -213,6 +237,7 @@ immediately after checkin. .PP The .BR \-l , +bare .BR \-r , and .B \-u @@ -221,7 +246,7 @@ For example, .B "ci\ \-u\ \-r" is equivalent to .B "ci\ \-r" -because +because bare .B \-r overrides .BR \-u . @@ -244,7 +269,7 @@ several sites should be checked in with the .B \-k option at these sites to preserve the original number, date, author, and state. -The extracted keyword values and the default log message may be overridden +The extracted keyword values and the default log message can be overridden with the options .BR \-d , .BR \-m , @@ -259,6 +284,14 @@ unless .B \-f is given. .TP +.BR \-i [\f2rev\fP] +initial checkin; report an error if the \*r file already exists. +This avoids race conditions in certain applications. +.TP +.BR \-j [\f2rev\fP] +just checkin and do not initialize; +report an error if the \*r file does not already exist. +.TP .BR \-I [\f2rev\fP] interactive mode; the user is prompted and questioned @@ -296,6 +329,18 @@ Use this option with care; it can confuse uses the string .I msg as the log message for all revisions checked in. +By convention, log messages that start with +.B # +are comments and are ignored by programs like GNU Emacs's +.B vc +package. +Also, log messages that start with +.BI { clumpname } +(followed by white space) are meant to be clumped together if possible, +even if they are associated with different files; the +.BI { clumpname } +label is used only for clumping, +and is not considered to be part of the log message itself. .TP .BI \-n "name" assigns the symbolic name @@ -326,7 +371,7 @@ into the \*r file, deleting the existing text. The .I file -may not begin with +cannot begin with .BR \- . .TP .BI \-t\- string @@ -356,6 +401,41 @@ For backward compatibility with older versions of \*r, a bare option is ignored. .RE .TP +.B \-T +Set the \*r file's modification time to the new revision's time +if the former precedes the latter and there is a new revision; +preserve the \*r file's modification time otherwise. +If you have locked a revision, +.B ci +usually updates the \*r file's modification time to the current time, +because the lock is stored in the \*r file +and removing the lock requires changing the \*r file. +This can create an \*r file newer than the working file in one of two ways: +first, +.B "ci\ \-M" +can create a working file with a date before the current time; +second, when reverting to the previous revision +the \*r file can change while the working file remains unchanged. +These two cases can cause excessive recompilation caused by a +.BR make (1) +dependency of the working file on the \*r file. +The +.B \-T +option inhibits this recompilation by lying about the \*r file's date. +Use this option with care; it can suppress recompilation even when +a checkin of one working file should affect +another working file associated with the same \*r file. +For example, suppose the \*r file's time is 01:00, +the (changed) working file's time is 02:00, +some other copy of the working file has a time of 03:00, +and the current time is 04:00. +Then +.B "ci\ \-d\ \-T" +sets the \*r file's time to 02:00 instead of the usual 04:00; +this causes +.BR make (1) +to think (incorrectly) that the other copy is newer than the \*r file. +.TP .BI \-w "login" uses .I login @@ -364,6 +444,9 @@ Useful for lying about the author, and for .B \-k if no author is available. .TP +.BI \-V +Print \*r's version number. +.TP .BI \-V n Emulate \*r version .IR n . @@ -375,9 +458,9 @@ for details. specifies the suffixes for \*r files. A nonempty suffix matches any pathname ending in the suffix. An empty suffix matches any pathname of the form -.BI RCS/ file +.BI RCS/ path or -.IB path /RCS/ file. +.IB path1 /RCS/ path2. The .B \-x option can specify a list of suffixes @@ -398,10 +481,49 @@ The default for .IR suffixes is installation-dependent; normally it is .B ,v/ -for hosts like Unix that permit commas in file names, +for hosts like Unix that permit commas in filenames, and is empty (i.e. just the empty suffix) for other hosts. +.TP +.BI \-z zone +specifies the date output format in keyword substitution, +and specifies the default time zone for +.I date +in the +.BI \-d date +option. +The +.I zone +should be empty, a numeric \*u offset, or the special string +.B LT +for local time. +The default is an empty +.IR zone , +which uses the traditional \*r format of \*u without any time zone indication +and with slashes separating the parts of the date; +otherwise, times are output in \*i 8601 format with time zone indication. +For example, if local time is January 11, 1990, 8pm Pacific Standard Time, +eight hours west of \*u, +then the time is output as follows: +.RS +.LP +.RS +.nf +.ta \w'\f3\-z+05:30\fP 'u +\w'\f31990-01-11 09:30:00+05:30\fP 'u +.ne 4 +\f2option\fP \f2time output\fP +\f3\-z\fP \f31990/01/12 04:00:00\fP \f2(default)\fP +\f3\-zLT\fP \f31990-01-11 20:00:00\-08\fP +\f3\-z+05:30\fP \f31990-01-12 09:30:00+05:30\fP +.ta 4n +4n +4n +4n +.fi +.RE +.LP +The +.B \-z +option does not affect dates stored in \*r files, +which are always \*u. .SH "FILE NAMING" -Pairs of \*r files and working files may be specified in three ways +Pairs of \*r files and working files can be specified in three ways (see also the example section). .PP @@ -423,9 +545,9 @@ If .I X is empty, .IB path1 / -must be +must start with .B RCS/ -or must end in +or must contain .BR /RCS/ . .PP 2) Only the \*r file is given. Then the working file is created in the current @@ -516,7 +638,7 @@ preserves its read and execute permissions. .B ci always turns off all write permissions of \*r files. .SH FILES -Several temporary files may be created in the directory containing +Temporary files are created in the directory containing the working file, and also in the temporary directory (see .B \s-1TMPDIR\s0 under @@ -576,21 +698,23 @@ who can check in new revisions but cannot otherwise change the \*r files. .SH "SETUID USE" To prevent anybody but their \*r administrator from deleting revisions, a set of users can employ setuid privileges as follows. -.nr n \w'\(bu '+1n-1/1n -.IP \(bu \nn +.nr n \w'\(bu'+2n-1/1n +.ds n \nn +.if \n(.g .if r an-tag-sep .ds n \w'\(bu'u+\n[an-tag-sep]u +.IP \(bu \*n Check that the host supports \*r setuid use. Consult a trustworthy expert if there are any doubts. It is best if the -.B seteuid() +.B seteuid system call works as described in Posix 1003.1a Draft 5, because \*r can switch back and forth easily between real and effective users, even if the real user is .BR root . If not, the second best is if the -.B setuid() +.B setuid system call supports saved setuid (the {\s-1_POSIX_SAVED_IDS\s0} behavior of Posix 1003.1-1990); -this fails only if the real user is +this fails only if the real or effective user is .BR root . If \*r detects any failure in setuid, it quits immediately. .IP \(bu \nn @@ -599,7 +723,7 @@ Choose a user to serve as \*r administrator for the set of users. Only .I A -will be able to invoke the +can invoke the .B rcs command on the users' \*r files. .I A @@ -608,9 +732,9 @@ should not be or any other user with special powers. Mutually suspicious sets of users should use different administrators. .IP \(bu \nn -Choose a path name +Choose a pathname .I B -that will be a directory of files to be executed by the users. +to be a directory of files to be executed by the users. .IP \(bu \nn Have .I A @@ -733,8 +857,9 @@ Useful options include .BR \-q , .BR \-V , +.BR \-x , and -.BR \-x . +.BR \-z . .TP .B \s-1TMPDIR\s0 Name of the temporary directory. @@ -755,14 +880,16 @@ The exit status is zero if and only if all operations were successful. .SH IDENTIFICATION Author: Walter F. Tichy. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990, 1991 by Paul Eggert. +Copyright \(co 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert. .SH "SEE ALSO" -co(1), ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1), -rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5) +co(1), +emacs(1), +ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1), +rcsintro(1), rcsmerge(1), rlog(1), setuid(2), rcsfile(5) .br Walter F. Tichy, \*r\*-A System for Version Control, diff --git a/gnu/usr.bin/rcs/doc/rcs.ms b/gnu/usr.bin/rcs/doc/rcs.ms index 7b3f8077269..1c908100c5c 100644 --- a/gnu/usr.bin/rcs/doc/rcs.ms +++ b/gnu/usr.bin/rcs/doc/rcs.ms @@ -3,15 +3,6 @@ .\" .\" \*s stands for $, and avoids problems when this file is checked in. .ds s $ -.\" PS and PE center pic diagrams. (The corresponding ms-macros may not.) -.de PS -.nr pE (\\n(.lu-\\$2u)/2u -.in +\\n(pEu -.ne \\$1u -.. -.de PE -.in -\\n(pEu -.. .de D( .DS .nr VS 12p @@ -27,7 +18,7 @@ .de Id .ND \\$4 .. -.Id $Id: rcs.ms,v 5.2 1991/01/03 10:57:28 eggert Exp $ +.Id $Id: rcs.ms,v 5.4 1995/06/01 16:23:43 eggert Exp $ .RP .TL RCS\*-A System for Version Control @@ -292,7 +283,7 @@ has a similar function. It accumulates the log messages that are requested during check-in. Thus, one can maintain the complete history of a revision directly inside it, by enclosing it in a comment. -Figure 1 is a partial reproduction of a log contained in revision 4.1 of +Figure 1 is an edited version of a log contained in revision 4.1 of the file \fIci.c\fR. The log appears at the beginning of the file, and makes it easy to determine what the recent modifications were. .sp @@ -301,23 +292,25 @@ and makes it easy to determine what the recent modifications were. .ne 18 .nf .in +0.5i -/* \*sLog: ci.c,v \*s - * Revision 4.1 1983/05/10 17:03:06 wft - * Added option \-d and \-w, and updated assignment of date, etc. to new delta. - * Added handling of default branches. - * - * Revision 3.9 1983/02/15 15:25:44 wft - * Added call to fastcopy() to copy remainder of RCS file. - * - * Revision 3.8 1983/01/14 15:34:05 wft - * Added ignoring of interrupts while new RCS file is renamed; - * avoids deletion of RCS files by interrupts. - * - * Revision 3.7 1982/12/10 16:09:20 wft - * Corrected checking of return code from diff. - * An RCS file now inherits its mode during the first ci from the working file, - * except that write permission is removed. - */ +/* +.in +\w'/'u +* \*sLog: ci.c,v \*s +* Revision 4.1 1983/05/10 17:03:06 wft +* Added option \-d and \-w, and updated assignment of date, etc. to new delta. +* Added handling of default branches. +* +* Revision 3.9 1983/02/15 15:25:44 wft +* Added call to fastcopy() to copy remainder of RCS file. +* +* Revision 3.8 1983/01/14 15:34:05 wft +* Added ignoring of interrupts while new RCS file is renamed; +* avoids deletion of RCS files by interrupts. +* +* Revision 3.7 1982/12/10 16:09:20 wft +* Corrected checking of return code from diff. +* An RCS file now inherits its mode during the first ci from the working file, +* except that write permission is removed. +*/ .in 0 .ce 1 Figure 1. Log entries produced by the marker \*sLog\*s. @@ -421,7 +414,7 @@ between 1.3 and 1.3.1.1 into a revision at level 2. The operation \fIrcsmerge\fR automates this process (see the Appendix). .ne 7 -.PS 4i +.PS 4i .ps -2 box "1.1" arrow @@ -460,7 +453,7 @@ that the customer has received revision 1.3, added his local modifications as revision 1.3.1.1, then received revision 2.4, and merged 2.4 and 1.3.1.1, resulting in 2.4.1.1. .ne 7 -.PS 4i +.PS 4i .ps -2 R13: box "1.3" line invis @@ -561,7 +554,7 @@ branch revision is reached. Figure 5 illustrates a tree with one side branch. Triangles pointing to the left and right represent reverse and forward deltas, respectively. .ne 8 -.PS 4i +.PS 4i .ps -2 define BD X [line invis $1 right .5; line up .3 then left .5 down .3 then right .5 down .3 then up .3] X @@ -570,21 +563,21 @@ define FD X [line invis $1 right .5; line left .5 down .3 then up .6 then right .5 down .3;] X right -D11: BD(" 1.1") +D11: BD(" 1.1") arrow right from D11.e -D12: BD(" 1.2") - arrow right from D12.e -D13: BD(" 1.3") - arrow right from D13.e -D21: BD(" 2.1") - arrow right from D21.e -D22: box "2.2" +D12: BD(" 1.2") + arrow right from D12.e +D13: BD(" 1.3") + arrow right from D13.e +D21: BD(" 2.1") + arrow right from D21.e +D22: box "2.2" line invis down from D21.s -F1: FD("1.3.1.1 ") +F1: FD("1.3.1.1 ") arrow from D13.se to F1.w arrow from F1.e right right -F2: FD("1.3.1.2 ") +F2: FD("1.3.1.2 ") .ps +2 .PE .ce 1 @@ -1291,9 +1284,10 @@ locks, unlocks, breaks locks, toggles the strict-locking feature, sets state attributes and symbolic revision numbers, changes the description, and deletes revisions. A revision can only be deleted if it is not the fork of a side branch. +.br +.ne 10 .IP "\fIrcsclean\fP \fB\- clean working directory\fP" .sp 0 -.ne 10 \fIRcsclean\fR removes working files that were checked out but never changed.* .FS * The \fIrcsclean\fP and \fIrcsfreeze\fP commands diff --git a/gnu/usr.bin/rcs/ident/ident.1 b/gnu/usr.bin/rcs/ident/ident.1 index 37c8eda202a..33c10eb8126 100644 --- a/gnu/usr.bin/rcs/ident/ident.1 +++ b/gnu/usr.bin/rcs/ident/ident.1 @@ -3,25 +3,28 @@ .ds Dt \\$4 .ds iD \\$3 \\$4 \\$5 \\$6 \\$7 .. -.Id $Id: ident.1,v 5.0 1990/08/22 09:09:36 eggert Exp $ -.ds r \s-1RCS\s0 +.Id $Id: ident.1,v 5.4 1993/11/09 17:40:15 eggert Exp $ +.ds r \&\s-1RCS\s0 +.ds u \&\s-1UTC\s0 .if n .ds - \%-- .if t .ds - \(em .TH IDENT 1 \*(Dt GNU .SH NAME -ident \- identify files +ident \- identify RCS keyword strings in files .SH SYNOPSIS .B ident [ .B \-q ] [ +.B \-V +] [ .I file \&.\|.\|. ] .SH DESCRIPTION .B ident -searches for all occurrences of the pattern -.BI $ keyword : .\|.\|. $ -in the named files or, if no file name appears, the standard input. +searches for all instances of the pattern +.BI $ keyword : "\ text\ " $ +in the named files or, if no files are named, the standard input. .PP These patterns are normally inserted automatically by the \*r command .BR co (1), @@ -30,6 +33,11 @@ The option .B \-q suppresses the warning given if there are no patterns in a file. +The option +.B \-V +prints +.BR ident 's +version number. .PP .B ident works on text files as well as object files and dumps. @@ -37,7 +45,15 @@ For example, if the C program in .B f.c contains .IP -\f3char rcsid[] = \&"$\&Id: f.c,v \*(iD $\&";\fP +.ft 3 +#include +.br +static char const rcsid[] = +.br + \&"$\&Id: f.c,v \*(iD $\&"; +.br +int main() { return printf(\&"%s\en\&", rcsid) == EOF; } +.ft P .LP and .B f.c @@ -57,14 +73,104 @@ f.o: $\&Id: f.c,v \*(iD $ .ft .fi +.PP +If a C program defines a string like +.B rcsid +above but does not use it, +.BR lint (1) +may complain, and some C compilers will optimize away the string. +The most reliable solution is to have the program use the +.B rcsid +string, as shown in the example above. +.PP +.B ident +finds all instances of the +.BI $ keyword : "\ text\ " $ +pattern, even if +.I keyword +is not actually an \*r-supported keyword. +This gives you information about nonstandard keywords like +.BR $\&XConsortium$ . +.SH KEYWORDS +Here is the list of keywords currently maintained by +.BR co (1). +All times are given in Coordinated Universal Time (\*u, +sometimes called \&\s-1GMT\s0) by default, but if the files +were checked out with +.BR co 's +.BI \-z zone +option, times are given with a numeric time zone indication appended. +.TP +.B $\&Author$ +The login name of the user who checked in the revision. +.TP +.B $\&Date$ +The date and time the revision was checked in. +.TP +.B $\&Header$ +A standard header containing the full pathname of the \*r file, the +revision number, the date and time, the author, the state, +and the locker (if locked). +.TP +.B $\&Id$ +Same as +.BR $\&Header$ , +except that the \*r filename is without a path. +.TP +.B $\&Locker$ +The login name of the user who locked the revision (empty if not locked). +.TP +.B $\&Log$ +The log message supplied during checkin. +For +.BR ident 's +purposes, this is equivalent to +.BR $\&RCSfile$ . +.TP +.B $\&Name$ +The symbolic name used to check out the revision, if any. +.TP +.B $\&RCSfile$ +The name of the \*r file without a path. +.TP +.B $\&Revision$ +The revision number assigned to the revision. +.TP +.B $\&Source$ +The full pathname of the \*r file. +.TP +.B $\&State$ +The state assigned to the revision with the +.B \-s +option of +.BR rcs (1) +or +.BR ci (1). +.PP +.BR co (1) +represents the following characters in keyword values by escape sequences +to keep keyword strings well-formed. +.LP +.RS +.nf +.ne 6 +.ta \w'newline 'u +\f2char escape sequence\fP +tab \f3\et\fP +newline \f3\en\fP +space \f3\e040 +$ \e044 +\e \e\e\fP +.fi +.RE .SH IDENTIFICATION Author: Walter F. Tichy. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990 by Paul Eggert. +Copyright \(co 1990, 1992, 1993 Paul Eggert. .SH "SEE ALSO" ci(1), co(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5) diff --git a/gnu/usr.bin/rcs/lib/maketime.h b/gnu/usr.bin/rcs/lib/maketime.h new file mode 100644 index 00000000000..fbe12562051 --- /dev/null +++ b/gnu/usr.bin/rcs/lib/maketime.h @@ -0,0 +1,39 @@ +/* Yield time_t from struct partime yielded by partime. */ + +/* Copyright 1993, 1994, 1995 Paul Eggert + Distributed under license by the Free Software Foundation, Inc. + +This file is part of RCS. + +RCS is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +RCS is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with RCS; see the file COPYING. +If not, write to the Free Software Foundation, +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +Report problems and direct all questions to: + + rcs-bugs@cs.purdue.edu + +*/ + +#if defined(__STDC__) || has_prototypes +# define __MAKETIME_P(x) x +#else +# define __MAKETIME_P(x) () +#endif + +struct tm *time2tm __MAKETIME_P((time_t,int)); +time_t difftm __MAKETIME_P((struct tm const *, struct tm const *)); +time_t str2time __MAKETIME_P((char const *, time_t, long)); +time_t tm2time __MAKETIME_P((struct tm *, int)); +void adjzone __MAKETIME_P((struct tm *, long)); diff --git a/gnu/usr.bin/rcs/lib/merger.c b/gnu/usr.bin/rcs/lib/merger.c index 7162ffa58eb..003e0a6906c 100644 --- a/gnu/usr.bin/rcs/lib/merger.c +++ b/gnu/usr.bin/rcs/lib/merger.c @@ -1,6 +1,6 @@ -/* merger - three-way file merge internals */ +/* three-way file merge internals */ -/* Copyright 1991 by Paul Eggert +/* Copyright 1991, 1992, 1993, 1994, 1995 Paul Eggert Distributed under license by the Free Software Foundation, Inc. This file is part of RCS. @@ -16,8 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with RCS; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +along with RCS; see the file COPYING. +If not, write to the Free Software Foundation, +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Report problems and direct all questions to: @@ -27,38 +28,40 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(mergerId, "$Id: merger.c,v 1.3 1991/08/20 23:05:00 eggert Exp $") +libId(mergerId, "$Id: merger.c,v 1.7 1995/06/16 06:19:24 eggert Exp $") + static char const *normalize_arg P((char const*,char**)); static char const * normalize_arg(s, b) char const *s; char **b; /* * If S looks like an option, prepend ./ to it. Yield the result. - * Set *B to the address of any storage that was allocated.. + * Set *B to the address of any storage that was allocated. */ { char *t; - switch (*s) { - case '-': case '+': - *b = t = testalloc(strlen(s) + 3); - VOID sprintf(t, ".%c%s", SLASH, s); - return t; - default: - *b = 0; - return s; + if (*s == '-') { + *b = t = testalloc(strlen(s) + 3); + VOID sprintf(t, ".%c%s", SLASH, s); + return t; + } else { + *b = 0; + return s; } } int -merge(tostdout, label, argv) +merge(tostdout, edarg, label, argv) int tostdout; - char const *const label[2]; + char const *edarg; + char const *const label[3]; char const *const argv[3]; /* - * Do `merge [-p] -L l0 -L l1 a0 a1 a2', + * Do `merge [-p] EDARG -L l0 -L l1 -L l2 a0 a1 a2', * where TOSTDOUT specifies whether -p is present, - * LABEL gives l0 and l1, and ARGV gives a0, a1, and a2. + * EDARG gives the editing type (e.g. "-A", or null for the default), + * LABEL gives l0, l1 and l2, and ARGV gives a0, a1 and a2. * Yield DIFF_SUCCESS or DIFF_FAILURE. */ { @@ -74,30 +77,35 @@ merge(tostdout, label, argv) for (i=3; 0<=--i; ) a[i] = normalize_arg(argv[i], &b[i]); + + if (!edarg) + edarg = "-E"; #if DIFF3_BIN t = 0; if (!tostdout) t = maketemp(0); s = run( - (char*)0, t, - DIFF3, "-am", "-L", label[0], "-L", label[1], + -1, t, + DIFF3, edarg, "-am", + "-L", label[0], + "-L", label[1], + "-L", label[2], a[0], a[1], a[2], (char*)0 ); switch (s) { case DIFF_SUCCESS: break; case DIFF_FAILURE: - if (!quietflag) - warn("overlaps during merge"); + warn("conflicts during merge"); break; default: exiterr(); } if (t) { - if (!(f = fopen(argv[0], FOPEN_W))) + if (!(f = fopenSafer(argv[0], "w"))) efaterror(argv[0]); - if (!(rt = Iopen(t, FOPEN_R, (struct stat*)0))) + if (!(rt = Iopen(t, "r", (struct stat*)0))) efaterror(t); fastcopy(rt, f); Ifclose(rt); @@ -106,29 +114,30 @@ merge(tostdout, label, argv) #else for (i=0; i<2; i++) switch (run( - (char*)0, d[i]=maketemp(i), + -1, d[i]=maketemp(i), DIFF, a[i], a[2], (char*)0 )) { case DIFF_FAILURE: case DIFF_SUCCESS: break; - default: exiterr(); + default: faterror("diff failed"); } t = maketemp(2); s = run( - (char*)0, t, - DIFF3, "-E", d[0], d[1], a[0], a[1], a[2], - label[0], label[1], (char*)0 + -1, t, + DIFF3, edarg, d[0], d[1], a[0], a[1], a[2], + label[0], label[2], (char*)0 ); if (s != DIFF_SUCCESS) { s = DIFF_FAILURE; - if (!quietflag) - warn("overlaps or other problems during merge"); + warn("overlaps or other problems during merge"); } - if (!(f = fopen(t, "a"))) + if (!(f = fopenSafer(t, "a+"))) efaterror(t); aputs(tostdout ? "1,$p\n" : "w\n", f); - Ofclose(f); - if (run(t, (char*)0, ED, "-", a[0], (char*)0)) + Orewind(f); + aflush(f); + if (run(fileno(f), (char*)0, ED, "-", a[0], (char*)0)) exiterr(); + Ofclose(f); #endif tempunlink(); diff --git a/gnu/usr.bin/rcs/lib/partime.h b/gnu/usr.bin/rcs/lib/partime.h new file mode 100644 index 00000000000..5d3983fbb04 --- /dev/null +++ b/gnu/usr.bin/rcs/lib/partime.h @@ -0,0 +1,71 @@ +/* Parse a string, yielding a struct partime that describes it. */ + +/* Copyright 1993, 1994, 1995 Paul Eggert + Distributed under license by the Free Software Foundation, Inc. + +This file is part of RCS. + +RCS is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +RCS is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with RCS; see the file COPYING. +If not, write to the Free Software Foundation, +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +Report problems and direct all questions to: + + rcs-bugs@cs.purdue.edu + +*/ + +#define TM_UNDEFINED (-1) +#define TM_DEFINED(x) (0 <= (x)) + +#define TM_UNDEFINED_ZONE ((long) -24 * 60 * 60) +#define TM_LOCAL_ZONE (TM_UNDEFINED_ZONE - 1) + +struct partime { + /* + * This structure describes the parsed time. + * Only the following tm_* values in it are used: + * sec, min, hour, mday, mon, year, wday, yday. + * If TM_UNDEFINED(value), the parser never found the value. + * The tm_year field is the actual year, not the year - 1900; + * but see ymodulus below. + */ + struct tm tm; + + /* + * If !TM_UNDEFINED(ymodulus), + * then tm.tm_year is actually modulo ymodulus. + */ + int ymodulus; + + /* + * Week of year, ISO 8601 style. + * If TM_UNDEFINED(yweek), the parser never found yweek. + * Weeks start on Mondays. + * Week 1 includes Jan 4. + */ + int yweek; + + /* Seconds east of UTC; or TM_LOCAL_ZONE or TM_UNDEFINED_ZONE. */ + long zone; +}; + +#if defined(__STDC__) || has_prototypes +# define __PARTIME_P(x) x +#else +# define __PARTIME_P(x) () +#endif + +char *partime __PARTIME_P((char const *, struct partime *)); +char *parzone __PARTIME_P((char const *, long *)); diff --git a/gnu/usr.bin/rcs/lib/rcsmap.c b/gnu/usr.bin/rcs/lib/rcsmap.c index 0e7b23c85f4..0345ef82f24 100644 --- a/gnu/usr.bin/rcs/lib/rcsmap.c +++ b/gnu/usr.bin/rcs/lib/rcsmap.c @@ -1,7 +1,7 @@ /* RCS map of character types */ /* Copyright (C) 1982, 1988, 1989 Walter Tichy - Copyright 1990, 1991 by Paul Eggert + Copyright 1990, 1991, 1995 by Paul Eggert Distributed under license by the Free Software Foundation, Inc. This file is part of RCS. @@ -17,8 +17,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with RCS; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +along with RCS; see the file COPYING. +If not, write to the Free Software Foundation, +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Report problems and direct all questions to: @@ -28,7 +29,7 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(mapId, "$Id: rcsmap.c,v 5.2 1991/08/19 03:13:55 eggert Exp $") +libId(mapId, "$Id: rcsmap.c,v 5.3 1995/06/16 06:19:24 eggert Exp $") /* map of character types */ /* ISO 8859/1 (Latin-1) */ diff --git a/gnu/usr.bin/rcs/lib/rcstime.c b/gnu/usr.bin/rcs/lib/rcstime.c new file mode 100644 index 00000000000..a49a8576c51 --- /dev/null +++ b/gnu/usr.bin/rcs/lib/rcstime.c @@ -0,0 +1,191 @@ +/* Convert between RCS time format and Posix and/or C formats. */ + +/* Copyright 1992, 1993, 1994, 1995 Paul Eggert + Distributed under license by the Free Software Foundation, Inc. + +This file is part of RCS. + +RCS is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +RCS is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with RCS; see the file COPYING. +If not, write to the Free Software Foundation, +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +Report problems and direct all questions to: + + rcs-bugs@cs.purdue.edu + +*/ + +#include "rcsbase.h" +#include "partime.h" +#include "maketime.h" + +libId(rcstimeId, "$Id: rcstime.c,v 1.4 1995/06/16 06:19:24 eggert Exp $") + +static long zone_offset; /* seconds east of UTC, or TM_LOCAL_ZONE */ +static int use_zone_offset; /* if zero, use UTC without zone indication */ + +/* +* Convert Unix time to RCS format. +* For compatibility with older versions of RCS, +* dates from 1900 through 1999 are stored without the leading "19". +*/ + void +time2date(unixtime,date) + time_t unixtime; + char date[datesize]; +{ + register struct tm const *tm = time2tm(unixtime, RCSversiontm_year + ((unsigned)tm->tm_year < 100 ? 0 : 1900), + tm->tm_mon+1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec + ); +} + +/* Like str2time, except die if an error was found. */ +static time_t str2time_checked P((char const*,time_t,long)); + static time_t +str2time_checked(source, default_time, default_zone) + char const *source; + time_t default_time; + long default_zone; +{ + time_t t = str2time(source, default_time, default_zone); + if (t == -1) + faterror("unknown date/time: %s", source); + return t; +} + +/* +* Parse a free-format date in SOURCE, convert it +* into RCS internal format, and store the result into TARGET. +*/ + void +str2date(source, target) + char const *source; + char target[datesize]; +{ + time2date( + str2time_checked(source, now(), + use_zone_offset ? zone_offset + : RCSversiontm_year + 1900, + z->tm_mon + 1, z->tm_mday, z->tm_hour, z->tm_min, z->tm_sec, + c, (int) (zone / (60*60)) + ); + if ((non_hour = zone % (60*60))) { +# if has_printf_dot + static char const fmt[] = ":%.2d"; +# else + static char const fmt[] = ":%02d"; +# endif + VOID sprintf(datebuf + strlen(datebuf), fmt, non_hour / 60); + if ((non_hour %= 60)) + VOID sprintf(datebuf + strlen(datebuf), fmt, non_hour); + } + } + return datebuf; +} diff --git a/gnu/usr.bin/rcs/lib/version.c b/gnu/usr.bin/rcs/lib/version.c new file mode 100644 index 00000000000..81f5585b9d1 --- /dev/null +++ b/gnu/usr.bin/rcs/lib/version.c @@ -0,0 +1,2 @@ +#include "rcsbase.h" +char const RCS_version_string[] = "5.7"; diff --git a/gnu/usr.bin/rcs/merge/merge.1 b/gnu/usr.bin/rcs/merge/merge.1 index 8b1957fca09..e4860d25738 100644 --- a/gnu/usr.bin/rcs/merge/merge.1 +++ b/gnu/usr.bin/rcs/merge/merge.1 @@ -2,22 +2,14 @@ .ds Rv \\$3 .ds Dt \\$4 .. -.Id $Id: merge.1,v 5.3 1991/02/28 19:18:45 eggert Exp $ +.Id $Id: merge.1,v 5.7 1995/06/01 16:23:43 eggert Exp $ .TH MERGE 1 \*(Dt GNU .SH NAME merge \- three-way file merge .SH SYNOPSIS .B merge [ -.B \-L -.I label1 -[ -.B \-L -.I label3 -] ] [ -.B \-p -] [ -.B \-q +.I "options" ] .I "file1 file2 file3" .SH DESCRIPTION @@ -28,11 +20,8 @@ to .I file3 into .IR file1 . -The result goes to standard output if -.B \-p -is present, into -.I file1 -otherwise. +The result ordinarily goes into +.IR file1 . .B merge is useful for combining separate changes to an original. Suppose .I file2 @@ -46,57 +35,101 @@ Then .B merge combines both changes. .PP -An overlap occurs if both +A conflict occurs if both .I file1 and .I file3 have changes in a common segment of lines. -On a few older hosts where -.B diff3 -does not support the -.B \-E -option, +If a conflict is found, .B merge -does not detect overlaps, and merely supplies the changed lines from -.I file3. -On most hosts, if overlaps occur, -.B merge -outputs a message (unless the -.B \-q -option is given), -and includes both alternatives -in the result. The alternatives are delimited as follows: +normally outputs a warning and brackets the conflict with +.B <<<<<<< +and +.B >>>>>>> +lines. +A typical conflict will look like this: .LP .RS .nf -.BI <<<<<<< " file1" -.I "lines in file1" +.BI <<<<<<< " file A" +.I "lines in file A" .B "=======" -.I "lines in file3" -.BI >>>>>>> " file3" +.I "lines in file B" +.BI >>>>>>> " file B" .RE .fi .LP -If there are overlaps, the user should edit the result and delete one of the +If there are conflicts, the user should edit the result and delete one of the alternatives. -If the -.BI \-L "\ label1" -and -.BI \-L "\ label3" -options are given, the labels are output in place of the names -.I file1 -and +.SH OPTIONS +.TP +.B \-A +Output conflicts using the +.B \-A +style of +.BR diff3 (1), +if supported by +.BR diff3 . +This merges all changes leading from +.I file2 +to .I file3 -in overlap reports. +into +.IR file1 , +and generates the most verbose output. +.TP +\f3\-E\fP, \f3\-e\fP +These options specify conflict styles that generate less information +than +.BR \-A . +See +.BR diff3 (1) +for details. +The default is +.BR \-E . +With +.BR \-e , +.B merge +does not warn about conflicts. +.TP +.BI \-L " label" +This option may be given up to three times, and specifies labels +to be used in place of the corresponding file names in conflict reports. +That is, +.B "merge\ \-L\ x\ \-L\ y\ \-L\ z\ a\ b\ c" +generates output that looks like it came from files +.BR x , +.B y +and +.B z +instead of from files +.BR a , +.B b +and +.BR c . +.TP +.BI \-p +Send results to standard output instead of overwriting +.IR file1 . +.TP +.BI \-q +Quiet; do not warn about conflicts. +.BI \-V +Print \*r's version number. .SH DIAGNOSTICS -Exit status is 0 for no overlaps, 1 for some overlaps, 2 for trouble. +Exit status is 0 for no conflicts, 1 for some conflicts, 2 for trouble. .SH IDENTIFICATION Author: Walter F. Tichy. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990, 1991 by Paul Eggert. +Copyright \(co 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert. .SH SEE ALSO diff3(1), diff(1), rcsmerge(1), co(1). +.SH BUGS +It normally does not make sense to merge binary files as if they were text, but +.B merge +tries to do it anyway. +.br diff --git a/gnu/usr.bin/rcs/merge/merge.c b/gnu/usr.bin/rcs/merge/merge.c index 4067c184a25..44d33a3d054 100644 --- a/gnu/usr.bin/rcs/merge/merge.c +++ b/gnu/usr.bin/rcs/merge/merge.c @@ -1,6 +1,6 @@ /* merge - three-way file merge */ -/* Copyright 1991 by Paul Eggert +/* Copyright 1991, 1992, 1993, 1994, 1995 Paul Eggert Distributed under license by the Free Software Foundation, Inc. This file is part of RCS. @@ -16,8 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with RCS; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +along with RCS; see the file COPYING. +If not, write to the Free Software Foundation, +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Report problems and direct all questions to: @@ -27,44 +28,59 @@ Report problems and direct all questions to: #include "rcsbase.h" +static void badoption P((char const*)); static char const usage[] = - "\nmerge: usage: merge [-p] [-q] [-L label1 [-L label3]] file1 file2 file3\n"; + "\nmerge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3"; - static exiting void + static void badoption(a) char const *a; { - faterror("unknown option: %s%s", a-2, usage); + error("unknown option: %s%s", a, usage); } -mainProg(mergeId, "merge", "$Id: merge.c,v 1.2 1991/08/19 03:13:55 eggert Exp $") +mainProg(mergeId, "merge", "$Id: merge.c,v 1.8 1995/06/16 06:19:24 eggert Exp $") { register char const *a; - char const *label[2], *arg[3]; + char const *arg[3], *label[3], *edarg = 0; int labels, tostdout; labels = 0; tostdout = false; - while ((a = *++argv) && *a++ == '-') { + for (; (a = *++argv) && *a++ == '-'; --argc) { switch (*a++) { + case 'A': case 'E': case 'e': + if (edarg && edarg[1] != (*argv)[1]) + error("%s and %s are incompatible", + edarg, *argv + ); + edarg = *argv; + break; + case 'p': tostdout = true; break; case 'q': quietflag = true; break; + case 'L': - if (1=2) +.RI ( n \(>=2) (e.g., 3.1.1.1, 2.1.2.2, etc.) are linked as follows. All nodes whose first @@ -151,11 +181,11 @@ field of a node contains a list of the numbers of the first nodes of all sequences for which it is a branchpoint. This list is ordered in increasing numbers. .LP +The following diagram shows an example of an \*r file's organization. +.if !\np \{\ .nf .vs 12 -.ne 38 -Example: -.if t .in +0.5i +.ne 36 .cs 1 20 .eo @@ -195,12 +225,183 @@ Example: \ / .ec -.if t .in .cs 1 -.ce -Fig. 1: A revision tree .vs .fi +.\} +.if \np \{\ +.lf 232 +.PS 4.250i 3.812i +.\" -2.0625 -4.25 1.75 0 +.\" 0.000i 4.250i 3.812i 0.000i +.nr 00 \n(.u +.nf +.nr 0x 1 +\h'3.812i' +.sp -1 +.lf 242 +\h'2.062i-(\w'Head'u/2u)'\v'0.125i-(0v/2u)+0v+0.22m'Head +.sp -1 +\h'2.062i'\v'0.250i'\D'l0.000i 0.500i' +.sp -1 +\h'2.087i'\v'0.650i'\D'l-0.025i 0.100i' +.sp -1 +\h'2.062i'\v'0.750i'\D'l-0.025i -0.100i' +.sp -1 +\h'1.688i'\v'1.250i'\D'l0.750i 0.000i' +.sp -1 +\h'2.438i'\v'1.250i'\D'l0.000i -0.500i' +.sp -1 +\h'2.438i'\v'0.750i'\D'l-0.750i 0.000i' +.sp -1 +\h'1.688i'\v'0.750i'\D'l0.000i 0.500i' +.sp -1 +.lf 244 +\h'2.062i-(\w'2.1'u/2u)'\v'1.000i-(0v/2u)+0v+0.22m'2.1 +.sp -1 +\h'2.062i'\v'1.250i'\D'l0.000i 0.500i' +.sp -1 +\h'2.087i'\v'1.650i'\D'l-0.025i 0.100i' +.sp -1 +\h'2.062i'\v'1.750i'\D'l-0.025i -0.100i' +.sp -1 +.lf 246 +\h'2.062i-(\w'1.3'u/2u)'\v'2.000i-(1v/2u)+0v+0.22m'1.3 +.sp -1 +\h'2.062i'\v'2.250i'\D'l-0.375i -0.500i' +.sp -1 +\h'1.688i'\v'1.750i'\D'l0.750i 0.000i' +.sp -1 +\h'2.438i'\v'1.750i'\D'l-0.375i 0.500i' +.sp -1 +\h'1.875i'\v'2.000i'\D'~-0.500i 0.000i 0.000i -0.500i' +.sp -1 +\h'1.350i'\v'1.600i'\D'l0.025i -0.100i' +.sp -1 +\h'1.375i'\v'1.500i'\D'l0.025i 0.100i' +.sp -1 +.lf 249 +\h'1.375i-(\w'1.3.1.1'u/2u)'\v'1.250i-(1v/2u)+1v+0.22m'1.3.1.1 +.sp -1 +\h'1.375i'\v'1.000i'\D'l-0.375i 0.500i' +.sp -1 +\h'1.000i'\v'1.500i'\D'l0.750i 0.000i' +.sp -1 +\h'1.750i'\v'1.500i'\D'l-0.375i -0.500i' +.sp -1 +\h'2.062i'\v'2.250i'\D'l0.000i 0.500i' +.sp -1 +\h'2.087i'\v'2.650i'\D'l-0.025i 0.100i' +.sp -1 +\h'2.062i'\v'2.750i'\D'l-0.025i -0.100i' +.sp -1 +.lf 252 +\h'2.062i-(\w'1.2'u/2u)'\v'3.000i-(1v/2u)+0v+0.22m'1.2 +.sp -1 +\h'2.062i'\v'3.250i'\D'l-0.375i -0.500i' +.sp -1 +\h'1.688i'\v'2.750i'\D'l0.750i 0.000i' +.sp -1 +\h'2.438i'\v'2.750i'\D'l-0.375i 0.500i' +.sp -1 +\h'1.875i'\v'3.000i'\D'~-0.500i 0.000i -0.500i 0.000i -0.500i 0.000i 0.000i -0.500i' +.sp -1 +\h'0.350i'\v'2.600i'\D'l0.025i -0.100i' +.sp -1 +\h'0.375i'\v'2.500i'\D'l0.025i 0.100i' +.sp -1 +.lf 255 +\h'0.375i-(\w'1.2.1.1'u/2u)'\v'2.250i-(1v/2u)+1v+0.22m'1.2.1.1 +.sp -1 +\h'0.375i'\v'2.000i'\D'l-0.375i 0.500i' +.sp -1 +\h'0.000i'\v'2.500i'\D'l0.750i 0.000i' +.sp -1 +\h'0.750i'\v'2.500i'\D'l-0.375i -0.500i' +.sp -1 +\h'0.375i'\v'2.000i'\D'l0.000i -0.500i' +.sp -1 +\h'0.350i'\v'1.600i'\D'l0.025i -0.100i' +.sp -1 +\h'0.375i'\v'1.500i'\D'l0.025i 0.100i' +.sp -1 +.lf 257 +\h'0.375i-(\w'1.2.1.3'u/2u)'\v'1.250i-(1v/2u)+1v+0.22m'1.2.1.3 +.sp -1 +\h'0.375i'\v'1.000i'\D'l-0.375i 0.500i' +.sp -1 +\h'0.000i'\v'1.500i'\D'l0.750i 0.000i' +.sp -1 +\h'0.750i'\v'1.500i'\D'l-0.375i -0.500i' +.sp -1 +\h'2.250i'\v'3.000i'\D'~0.500i 0.000i 0.000i -0.500i' +.sp -1 +\h'2.725i'\v'2.600i'\D'l0.025i -0.100i' +.sp -1 +\h'2.750i'\v'2.500i'\D'l0.025i 0.100i' +.sp -1 +.lf 261 +\h'2.750i-(\w'1.2.2.1'u/2u)'\v'2.250i-(1v/2u)+1v+0.22m'1.2.2.1 +.sp -1 +\h'2.750i'\v'2.000i'\D'l-0.375i 0.500i' +.sp -1 +\h'2.375i'\v'2.500i'\D'l0.750i 0.000i' +.sp -1 +\h'3.125i'\v'2.500i'\D'l-0.375i -0.500i' +.sp -1 +\h'2.938i'\v'2.250i'\D'~0.500i 0.000i 0.000i -0.500i 0.000i -0.500i' +.sp -1 +\h'3.413i'\v'1.350i'\D'l0.025i -0.100i' +.sp -1 +\h'3.438i'\v'1.250i'\D'l0.025i 0.100i' +.sp -1 +.lf 264 +\h'3.438i-(\w'\s-21.2.2.1.1.1\s0'u/2u)'\v'1.000i-(1v/2u)+1v+0.22m'\s-21.2.2.1.1.1\s0 +.sp -1 +\h'3.438i'\v'0.750i'\D'l-0.375i 0.500i' +.sp -1 +\h'3.062i'\v'1.250i'\D'l0.750i 0.000i' +.sp -1 +\h'3.812i'\v'1.250i'\D'l-0.375i -0.500i' +.sp -1 +\h'2.750i'\v'2.000i'\D'l0.000i -0.500i' +.sp -1 +\h'2.725i'\v'1.600i'\D'l0.025i -0.100i' +.sp -1 +\h'2.750i'\v'1.500i'\D'l0.025i 0.100i' +.sp -1 +.lf 267 +\h'2.750i-(\w'1.2.2.2'u/2u)'\v'1.250i-(1v/2u)+1v+0.22m'1.2.2.2 +.sp -1 +\h'2.750i'\v'1.000i'\D'l-0.375i 0.500i' +.sp -1 +\h'2.375i'\v'1.500i'\D'l0.750i 0.000i' +.sp -1 +\h'3.125i'\v'1.500i'\D'l-0.375i -0.500i' +.sp -1 +\h'2.062i'\v'3.250i'\D'l0.000i 0.500i' +.sp -1 +\h'2.087i'\v'3.650i'\D'l-0.025i 0.100i' +.sp -1 +\h'2.062i'\v'3.750i'\D'l-0.025i -0.100i' +.sp -1 +.lf 270 +\h'2.062i-(\w'1.1'u/2u)'\v'4.000i-(1v/2u)+0v+0.22m'1.1 +.sp -1 +\h'2.062i'\v'4.250i'\D'l-0.375i -0.500i' +.sp -1 +\h'1.688i'\v'3.750i'\D'l0.750i 0.000i' +.sp -1 +\h'2.438i'\v'3.750i'\D'l-0.375i 0.500i' +.sp -1 +.sp 4.250i+1 +.if \n(00 .fi +.br +.nr 0x 0 +.lf 271 +.PE +.lf 272 +.\} .PP .SH IDENTIFICATION .de VL @@ -209,13 +410,14 @@ Fig. 1: A revision tree Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990, 1991 by Paul Eggert. +Copyright \(co 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert. .SH SEE ALSO -ci(1), co(1), ident(1), rcs(1), rcsdiff(1), rcsmerge(1), rlog(1), +rcsintro(1), ci(1), co(1), ident(1), rcs(1), rcsclean(1), rcsdiff(1), +rcsmerge(1), rlog(1) .br Walter F. Tichy, \*r\*-A System for Version Control, diff --git a/gnu/usr.bin/rcs/rcs/rcsintro.1 b/gnu/usr.bin/rcs/rcs/rcsintro.1 index a76caa0ee2d..fa970437b51 100644 --- a/gnu/usr.bin/rcs/rcs/rcsintro.1 +++ b/gnu/usr.bin/rcs/rcs/rcsintro.1 @@ -2,10 +2,20 @@ .ds Rv \\$3 .ds Dt \\$4 .. -.Id $Id: rcsintro.1,v 5.1 1991/04/21 12:00:46 eggert Exp $ +.Id $Id: rcsintro.1,v 5.3 1993/11/03 17:42:27 eggert Exp $ .ds r \&\s-1RCS\s0 .if n .ds - \%-- .if t .ds - \(em +.if !\n(.g \{\ +. if !\w|\*(lq| \{\ +. ds lq `` +. if \w'\(lq' .ds lq "\(lq +. \} +. if !\w|\*(rq| \{\ +. ds rq '' +. if \w'\(rq' .ds rq "\(rq +. \} +.\} .am SS .LP .. @@ -276,11 +286,11 @@ details. .SH IDENTIFICATION Author: Walter F. Tichy. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990, 1991 by Paul Eggert. +Copyright \(co 1990, 1991, 1992, 1993 Paul Eggert. .SH "SEE ALSO" ci(1), co(1), ident(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1) .br diff --git a/gnu/usr.bin/rcs/rcsclean/rcsclean.1 b/gnu/usr.bin/rcs/rcsclean/rcsclean.1 index 07ed7228b67..be58c94ccef 100644 --- a/gnu/usr.bin/rcs/rcsclean/rcsclean.1 +++ b/gnu/usr.bin/rcs/rcsclean/rcsclean.1 @@ -2,7 +2,7 @@ .ds Rv \\$3 .ds Dt \\$4 .. -.Id $Id: rcsclean.1,v 1.8 1991/11/03 01:09:19 eggert Exp $ +.Id $Id: rcsclean.1,v 1.12 1993/11/03 17:42:27 eggert Exp $ .ds r \&\s-1RCS\s0 .if n .ds - \%-- .if t .ds - \(em @@ -14,7 +14,11 @@ rcsclean \- clean up working files .RI [ options "] [ " file " .\|.\|. ]" .SH DESCRIPTION .B rcsclean -removes working files that were checked out and never modified. +removes files that are not being worked on. +.B "rcsclean \-u" +also unlocks and removes files that are being worked on +but have not changed. +.PP For each .I file given, @@ -32,13 +36,13 @@ and .B "rm \-f" commands on the standard output. .PP +Files are paired as explained in +.BR ci (1). If no .I file is given, all working files in the current directory are cleaned. Pathnames matching an \*r suffix denote \*r files; all others denote working files. -Names are paired as explained in -.BR ci (1). .PP The number of the revision to which the working file is compared may be attached to any of the options @@ -58,15 +62,15 @@ uses the latest revision on the default branch, normally the root. .B rcsclean is useful for .B clean -targets in Makefiles. +targets in makefiles. See also .BR rcsdiff (1), which prints out the differences, and .BR ci (1), which -normally asks whether to check in a file -if it was not changed. +normally reverts to the previous revision +if a file was not changed. .SH OPTIONS .TP .BI \-k subst @@ -89,9 +93,22 @@ Do not log the actions taken on standard output. .BR \-r [\f2rev\fP] This option has no effect other than specifying the revision for comparison. .TP +.B \-T +Preserve the modification time on the \*r file +even if the \*r file changes because a lock is removed. +This option can suppress extensive recompilation caused by a +.BR make (1) +dependency of some other copy of the working file on the \*r file. +Use this option with care; it can suppress recompilation even when it is needed, +i.e. when the lock removal +would mean a change to keyword strings in the other working file. +.TP .BR \-u [\f2rev\fP] Unlock the revision if it is locked and no difference is found. .TP +.BI \-V +Print \*r's version number. +.TP .BI \-V n Emulate \*r version .IR n . @@ -106,6 +123,14 @@ to characterize \*r files. See .BR ci (1) for details. +.TP +.BI \-z zone +Use +.I zone +as the time zone for keyword substitution; +see +.BR co (1) +for details. .SH EXAMPLES .LP .RS @@ -147,19 +172,20 @@ Useful options include .BR \-q , .BR \-V , +.BR \-x , and -.BR \-x . +.BR \-z . .SH DIAGNOSTICS The exit status is zero if and only if all operations were successful. Missing working files and \*r files are silently ignored. .SH IDENTIFICATION Author: Walter F. Tichy. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990, 1991 by Paul Eggert. +Copyright \(co 1990, 1991, 1992, 1993 Paul Eggert. .SH "SEE ALSO" ci(1), co(1), ident(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5) diff --git a/gnu/usr.bin/rcs/rcsclean/rcsclean.c b/gnu/usr.bin/rcs/rcsclean/rcsclean.c index ba24ab77e0b..3d8ecd3fe5d 100644 --- a/gnu/usr.bin/rcs/rcsclean/rcsclean.c +++ b/gnu/usr.bin/rcs/rcsclean/rcsclean.c @@ -1,6 +1,6 @@ -/* rcsclean - clean up working files */ +/* Clean up working files. */ -/* Copyright 1991 by Paul Eggert +/* Copyright 1991, 1992, 1993, 1994, 1995 Paul Eggert Distributed under license by the Free Software Foundation, Inc. This file is part of RCS. @@ -16,8 +16,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with RCS; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +along with RCS; see the file COPYING. +If not, write to the Free Software Foundation, +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Report problems and direct all questions to: @@ -37,16 +38,17 @@ static void cleanup P((void)); static RILE *workptr; static int exitstatus; -mainProg(rcscleanId, "rcsclean", "$Id: rcsclean.c,v 5.1 1991/11/03 01:11:44 eggert Exp $") +mainProg(rcscleanId, "rcsclean", "$Id: rcsclean.c,v 5.9 1995/06/16 06:19:24 eggert Exp $") { static char const usage[] = - "\nrcsclean: usage: rcsclean [-ksubst] [-{nqru}[rev]] [-Vn] [-xsuffixes] [file ...]"; + "\nrcsclean: usage: rcsclean -ksubst -{nqru}[rev] -T -Vn -xsuff -zzone file ..."; static struct buf revision; char *a, **newargv; char const *rev, *p; - int changelock, expmode, perform, unlocked, unlockflag, waslocked; + int dounlock, expmode, perform, unlocked, unlockflag, waslocked; + int Ttimeflag; struct hshentries *deltas; struct hshentry *delta; struct stat workstat; @@ -54,25 +56,26 @@ mainProg(rcscleanId, "rcsclean", "$Id: rcsclean.c,v 5.1 1991/11/03 01:11:44 egge setrid(); expmode = -1; - rev = nil; + rev = 0; suffixes = X_DEFAULT; perform = true; unlockflag = false; + Ttimeflag = false; argc = getRCSINIT(argc, argv, &newargv); argv = newargv; for (;;) { - if (--argc <= 0) { + if (--argc < 1) { # if has_dirent argc = get_directory(".", &newargv); argv = newargv; break; # else - faterror("no file names specified"); + faterror("no pathnames specified"); # endif } a = *++argv; - if (*a++ != '-') + if (!*a || *a++ != '-') break; switch (*a++) { case 'k': @@ -98,6 +101,12 @@ mainProg(rcscleanId, "rcsclean", "$Id: rcsclean.c,v 5.1 1991/11/03 01:11:44 egge } break; + case 'T': + if (*a) + goto unknown; + Ttimeflag = true; + break; + case 'u': unlockflag = true; goto handle_revision; @@ -110,25 +119,42 @@ mainProg(rcscleanId, "rcsclean", "$Id: rcsclean.c,v 5.1 1991/11/03 01:11:44 egge suffixes = a; break; + case 'z': + zone_set(a); + break; + default: unknown: - faterror("unknown option: %s%s", *argv, usage); + error("unknown option: %s%s", *argv, usage); } } - do { + dounlock = perform & unlockflag; + + if (nerror) + cleanup(); + else + for (; 0 < argc; cleanup(), ++argv, --argc) { + ffree(); if (!( - 0 < pairfilenames( + 0 < pairnames( argc, argv, - unlockflag&perform ? rcswriteopen : rcsreadopen, + dounlock ? rcswriteopen : rcsreadopen, true, true ) && - (workptr = Iopen(workfilename,FOPEN_R_WORK,&workstat)) + (workptr = Iopen(workname, FOPEN_R_WORK, &workstat)) )) continue; + if (same_file(RCSstat, workstat, 0)) { + rcserror("RCS file is the same as working file %s.", + workname + ); + continue; + } + gettree(); p = 0; @@ -155,11 +181,13 @@ mainProg(rcscleanId, "rcsclean", "$Id: rcsclean.c,v 5.1 1991/11/03 01:11:44 egge waslocked = delta && delta->lockedby; locker_expansion = unlock(delta); unlocked = locker_expansion & unlockflag; - changelock = unlocked & perform; if (unlockednum, RCSfilename); + aprintf(stdout, "rcs -u%s %s\n", delta->num, RCSname); - if_advise_access(changelock && deltas->first != delta, - finptr, MADV_SEQUENTIAL - ); - if (!donerewrite(changelock)) - continue; + if (perform & unlocked) { + if_advise_access(deltas->first != delta, finptr, MADV_SEQUENTIAL); + if (donerewrite(true, + Ttimeflag ? RCSstat.st_mtime : (time_t)-1 + ) != 0) + continue; + } if (!quietflag) - aprintf(stdout, "rm -f %s\n", workfilename); + aprintf(stdout, "rm -f %s\n", workname); Izclose(&workptr); - if (perform && un_link(workfilename) != 0) - eerror(workfilename); + if (perform && un_link(workname) != 0) + eerror(workname); - } while (cleanup(), ++argv, 0 < --argc); + } tempunlink(); if (!quietflag) @@ -213,16 +243,17 @@ cleanup() Izclose(&finptr); Izclose(&workptr); Ozclose(&fcopy); - Ozclose(&frewrite); + ORCSclose(); dirtempunlink(); } -#if lint -# define exiterr rcscleanExit +#if RCS_lint +# define exiterr rcscleanExit #endif - exiting void + void exiterr() { + ORCSerror(); dirtempunlink(); tempunlink(); _exit(EXIT_FAILURE); @@ -232,7 +263,7 @@ exiterr() unlock(delta) struct hshentry *delta; { - register struct lock **al, *l; + register struct rcslock **al, *l; if (delta && delta->lockedby && strcmp(getcaller(),delta->lockedby)==0) for (al = &Locks; (l = *al); al = &l->nextlock) @@ -269,7 +300,7 @@ get_directory(dirname, aargv) while ((errno = 0, e = readdir(d))) { char const *en = e->d_name; size_t s = strlen(en) + 1; - if (en[0]=='.' && (!en[1] || en[1]=='.' && !en[2])) + if (en[0]=='.' && (!en[1] || (en[1]=='.' && !en[2]))) continue; if (rcssuffix(en)) continue; @@ -281,7 +312,12 @@ get_directory(dirname, aargv) VOID strcpy(a+chars, en); chars += s; } - if (errno || closedir(d) != 0) +# if void_closedir +# define close_directory(d) (closedir(d), 0) +# else +# define close_directory(d) closedir(d) +# endif + if (errno || close_directory(d) != 0) efaterror(dirname); if (chars) a = trealloc(char, a, chars); diff --git a/gnu/usr.bin/rcs/rcsdiff/rcsdiff.1 b/gnu/usr.bin/rcs/rcsdiff/rcsdiff.1 index b78bbdd17c1..373c3376de7 100644 --- a/gnu/usr.bin/rcs/rcsdiff/rcsdiff.1 +++ b/gnu/usr.bin/rcs/rcsdiff/rcsdiff.1 @@ -2,7 +2,7 @@ .ds Rv \\$3 .ds Dt \\$4 .. -.Id $Id: rcsdiff.1,v 5.3 1991/04/21 12:00:46 eggert Exp $ +.Id $Id: rcsdiff.1,v 5.5 1993/11/03 17:42:27 eggert Exp $ .ds r \&\s-1RCS\s0 .if n .ds - \%-- .if t .ds - \(em @@ -20,10 +20,14 @@ rcsdiff \- compare RCS revisions [ .BI \-r rev2 ] ] [ -.BI \-V n +.B \-T +] [ +.RI "\f3\-V\fP[" n ] ] [ .BI \-x suffixes ] [ +.BI \-z zone +] [ .I "diff options" ] .I "file .\|.\|." @@ -68,9 +72,11 @@ See .BR co (1) for details about -.B \-V +.BR \-T , +.BR \-V , +.B \-x and -.BR \-x . +.BR \-z . Otherwise, all options of .BR diff (1) that apply to regular files are accepted, with the same meaning as for @@ -136,11 +142,11 @@ Exit status is 0 for no differences during any comparison, .SH IDENTIFICATION Author: Walter F. Tichy. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990, 1991 by Paul Eggert. +Copyright \(co 1990, 1991, 1992, 1993 Paul Eggert. .SH "SEE ALSO" ci(1), co(1), diff(1), ident(1), rcs(1), rcsintro(1), rcsmerge(1), rlog(1) .br diff --git a/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh b/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh index 421997946b7..96954f08b7c 100644 --- a/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh +++ b/gnu/usr.bin/rcs/rcsfreeze/rcsfreeze.sh @@ -2,7 +2,7 @@ # rcsfreeze - assign a symbolic revision number to a configuration of RCS files -# $Id: rcsfreeze.sh,v 4.4 1991/04/21 11:58:24 eggert Exp $ +# $Id: rcsfreeze.sh,v 4.6 1993/11/03 17:42:27 eggert Exp $ # The idea is to run rcsfreeze each time a new version is checked # in. A unique symbolic revision number (C_[number], where number @@ -25,22 +25,22 @@ # {RCS/}.rcsfreeze.ver version number # {RCS/}.rscfreeze.log log messages, most recent first -PATH=/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH +PATH=/usr/local/bin:/bin:/usr/bin:/usr/ucb:$PATH export PATH DATE=`date` || exit # Check whether we have an RCS subdirectory, so we can have the right # prefix for our paths. -if [ -d RCS ] -then RCSDIR=RCS/ -else RCSDIR= +if test -d RCS +then RCSDIR=RCS/ EXT= +else RCSDIR= EXT=,v fi # Version number stuff, log message file VERSIONFILE=${RCSDIR}.rcsfreeze.ver LOGFILE=${RCSDIR}.rcsfreeze.log # Initialize, rcsfreeze never run before in the current directory -[ -r $VERSIONFILE ] || { echo 0 >$VERSIONFILE && >>$LOGFILE; } || exit +test -r $VERSIONFILE || { echo 0 >$VERSIONFILE && >>$LOGFILE; } || exit # Get Version number, increase it, write back to file. VERSIONNUMBER=`cat $VERSIONFILE` && @@ -79,22 +79,21 @@ trap 'rm -f $TMPLOG; exit 1' 1 2 13 15 # combine old and new logfiles cp $TMPLOG $LOGFILE && -rm -f $TMPLOG || exit -trap 1 2 13 15 +rm -f $TMPLOG && # Now the real work begins by assigning a symbolic revision number -# to each rcs file. Take the most recent version of the main trunk. +# to each rcs file. Take the most recent version on the default branch. -status= - -for FILE in ${RCSDIR}* +# If there are any .*,v files, throw them in too. +# But ignore RCS/.* files that do not end in ,v. +DOTFILES= +for DOTFILE in ${RCSDIR}.*,v do -# get the revision number of the most recent revision - HEAD=`rlog -h $FILE` && - REV=`echo "$HEAD" | sed -n 's/^head:[ ]*//p'` && -# assign symbolic name to it. - echo >&2 "rcsfreeze: $REV $FILE" && - rcs -q -n$SYMREVNAME:$REV $FILE || status=$? + if test -f "$DOTFILE" + then + DOTFILES="${RCSDIR}.*,v" + break + fi done -exit $status +exec rcs -q -n$SYMREVNAME: ${RCSDIR}*$EXT $DOTFILES diff --git a/gnu/usr.bin/rcs/rcsmerge/rcsmerge.1 b/gnu/usr.bin/rcs/rcsmerge/rcsmerge.1 index 82871b033bf..96b6a46f063 100644 --- a/gnu/usr.bin/rcs/rcsmerge/rcsmerge.1 +++ b/gnu/usr.bin/rcs/rcsmerge/rcsmerge.1 @@ -2,7 +2,7 @@ .ds Rv \\$3 .ds Dt \\$4 .. -.Id $Id: rcsmerge.1,v 5.3 1991/08/19 03:13:55 eggert Exp $ +.Id $Id: rcsmerge.1,v 5.6 1995/06/01 16:23:43 eggert Exp $ .ds r \&\s-1RCS\s0 .if n .ds - \%-- .if t .ds - \(em @@ -38,6 +38,35 @@ the overlapping regions as explained in The command is useful for incorporating changes into a checked-out revision. .SH OPTIONS .TP +.B \-A +Output conflicts using the +.B \-A +style of +.BR diff3 (1), +if supported by +.BR diff3 . +This merges all changes leading from +.I file2 +to +.I file3 +into +.IR file1 , +and generates the most verbose output. +.TP +\f3\-E\fP, \f3\-e\fP +These options specify conflict styles that generate less information +than +.BR \-A . +See +.BR diff3 (1) +for details. +The default is +.BR \-E . +With +.BR \-e , +.B rcsmerge +does not warn about conflicts. +.TP .BI \-k subst Use .I subst @@ -51,6 +80,11 @@ ignores differences in keyword values when merging the changes from .B 1.1 to .BR 1.2 . +It normally does not make sense to merge binary files as if they were text, so +.B rcsmerge +refuses to merge files if +.B \-kb +expansion is used. .TP .BR \-p [\f2rev\fP] Send the result to standard output instead of overwriting the working file. @@ -65,6 +99,13 @@ Here an empty .I rev stands for the latest revision on the default branch, normally the head. .TP +.B \-T +This option has no effect; +it is present for compatibility with other \*r commands. +.TP +.BI \-V +Print \*r's version number. +.TP .BI \-V n Emulate \*r version .IR n . @@ -79,6 +120,14 @@ to characterize \*r files. See .BR ci (1) for details. +.TP +.BI \-z zone +Use +.I zone +as the time zone for keyword substitution. +See +.BR co (1) +for details. .SH EXAMPLES Suppose you have released revision 2.8 of .BR f.c . @@ -123,11 +172,11 @@ Exit status is 0 for no overlaps, 1 for some overlaps, 2 for trouble. .SH IDENTIFICATION Author: Walter F. Tichy. .br -Revision Number: \*(Rv; Release Date: \*(Dt. +Manual Page Revision: \*(Rv; Release Date: \*(Dt. .br -Copyright \(co 1982, 1988, 1989 by Walter F. Tichy. +Copyright \(co 1982, 1988, 1989 Walter F. Tichy. .br -Copyright \(co 1990, 1991 by Paul Eggert. +Copyright \(co 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert. .SH "SEE ALSO" ci(1), co(1), ident(1), merge(1), rcs(1), rcsdiff(1), rcsintro(1), rlog(1), rcsfile(5) diff --git a/gnu/usr.bin/rcs/rcstest b/gnu/usr.bin/rcs/rcstest index e0b6c828f7c..47eab4fc1d7 100755 --- a/gnu/usr.bin/rcs/rcstest +++ b/gnu/usr.bin/rcs/rcstest @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # Test RCS's functions. # The RCS commands are searched for in the PATH as usual; @@ -15,10 +15,10 @@ # The current directory and ./RCS must be readable, writable, and searchable. -# $Id: rcstest,v 5.8 1991/11/20 17:58:10 eggert Exp $ +# $Id: rcstest,v 5.14 1995/06/16 06:19:24 eggert Exp $ -# Copyright 1990, 1991 by Paul Eggert +# Copyright 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert # Distributed under license by the Free Software Foundation, Inc. # # This file is part of RCS. @@ -34,13 +34,23 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with RCS; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# along with RCS; see the file COPYING. +# If not, write to the Free Software Foundation, +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # Report problems and direct all questions to: # # rcs-bugs@cs.purdue.edu +# The Makefile overrides the following defaults. +: ${ALL_CFLAGS=-Dhas_conf_h} +: ${CC=cc} +: ${DIFF=diff} +# : ${LDFLAGS=} ${LIBS=} tickles old shell bug + +CL="$CC $ALL_CFLAGS $LDFLAGS -o a.out" +L=$LIBS + RCSINIT=-x export RCSINIT @@ -55,26 +65,26 @@ case $1 in *) echo >&2 "$0: usage: $0 [-v]"; exit 2 esac -test -d RCS || { - echo >&2 "$0: RCS: not a directory; please \`mkdir RCS' first." - exit 1 -} +if test -d RCS +then rmdir=: +else rmdir=rmdir; mkdir RCS || exit +fi rm -f a.* $RCSfile $RCS_alt $lockfile && echo 1.1 >a.11 && echo 1.1.1.1 >a.3x1 && echo 1.2 >a.12 || { echo "#initialization failed"; exit 2; } -case `diff -c a.11 a.3x1` in -*'! 1.1.1.1') - diff='diff -c';; +case "`$DIFF -c a.11 a.3x1`" in +*!\ 1.1.1.1) + diff="$DIFF -c";; *) - echo "#warning: diff -c does not work, so diagnostics may be cryptic" - diff=diff + echo "#warning: $DIFF -c does not work, so diagnostics may be cryptic" + diff=$DIFF esac rcs -i -L -ta.11 $q a.c && -<$RCSfile || { +test -r $RCSfile || { echo "#rcs -i -L failed; perhaps RCS is not properly installed." exit 1 } @@ -84,7 +94,7 @@ rm -f $RCSfile || exit 2 cp a.11 a.c && ci -ta.11 -mm $q a.c && -<$RCSfile && +test -r $RCSfile && rcs -L $q a.c || { echo "#ci+rcs -L failed"; exit 1; } test ! -f a.c || { echo "#ci did not remove working file"; exit 1; } for l in '' '-l' @@ -99,6 +109,7 @@ ci -mm $q a.c && co $q a.c && $diff a.12 a.c || { echo "#ci+co failed"; exit 1; } +rm -f a.c && co -r1.1 $q a.c && $diff a.11 a.c || { echo "#can't retrieve first revision"; exit 1; } @@ -108,21 +119,24 @@ ci -r1.1.1 -mm $q a.c && co -r1.1.1.1 $q a.c && $diff a.3x1 a.c || { echo "#branches failed"; exit 1; } +rm -f a.c && co -l $q a.c && ci -f -mm $q a.c && co -r1.3 $q a.c && $diff a.12 a.c || { echo "#(co -l; ci -f) failed"; exit 1; } +rm -f a.c && co -l $q a.c && echo 1.4 >a.c && ci -l -mm $q a.c && echo error >a.c && ci -mm $q a.c || { echo "#ci -l failed"; exit 1; } +rm -f a.c && co -l $q a.c && echo 1.5 >a.c && ci -u -mm $q a.c && -a.c || exit 2 ci -mm $q a.c 2>/dev/null && { echo "#ci -u didn't unlock the file"; exit 1; } @@ -166,42 +180,28 @@ case $LOGNAME in esac esac esac -date=`date -u 2>/dev/null` || -date=`TZ=GMT0 date 2>/dev/null` || -date=`TZ= date` || exit 2 -set $date -case $2 in -Jan) m=01;; Feb) m=02;; Mar) m=03;; Apr) m=04;; May) m=05;; Jun) m=06;; -Jul) m=07;; Aug) m=08;; Sep) m=09;; Oct) m=10;; Nov) m=11;; Dec) m=12;; -*) echo >&2 "$0: $2: unknown month name"; exit 2 + + +# Get the date of the previous revision in UTC. +date=`rlog -r a.c | sed -n '/^date: /{ s///; s/;.*//; p; q; }'` || exit +case $date in +[0-9][0-9][0-9]*[0-9]/[0-1][0-9]/[0-3][0-9]\ [0-2][0-9]:[0-5][0-9]:[0-6][0-9]);; +*) echo >&2 "$0: $date: bad rlog date output"; exit 1 esac -case $3 in -?) d=0$3;; -*) d=$3 -esac -case $6 in -[0-9][0-9][0-9][0-9]*) D=$6/$m/$d;; -*) - case $5 in - [0-9][0-9][0-9][0-9]*) D=$5/$m/$d;; - *) echo >&2 "$0: bad date format: $date"; exit 2 - esac -esac -T=$4 -case $PWD in -'') PWD=`pwd` -esac && +PWD=`pwd` && export PWD && +rm -f a.c && co -l $q a.c && sed 's/@/$/g' >a.kv <a.k && sed -e 's/w s [$]/w s '"$me"' $/' -e 's/[$]Locker: /&'"$me/" a.kv >a.kvl && -sed -e '/^\$/!d' -e 's/\$$/: old $/' a.k >a.o && +sed s/Oz//g a.kv >a.e && +sed s/Oz/N/g a.kv >a.N && +sed -e '/\$/!d' -e 's/\$$/: old $/' a.k >a.o && sed -e 's/\$[^ ]*: //' -e 's/ \$//' a.kv >a.v && cp a.o a.c && -ci -d"$date" -ss -ww -u2.1 -mm $q a.c && +ci -d"$date" -nOz -ss -ww -u2.1 -mm $q a.c && $diff a.kv a.c || { echo "#keyword expansion failed"; exit 1; } -co -p -ko $q a.c >a.oo && +co -pOz -ko $q a.c >a.oo && $diff a.o a.oo || { echo "#co -p -ko failed"; exit 1; } -cp a.kv a.o || exit 2 -rcs -o2.1 $q a.c && +cp a.kv a.o && cp a.o a.b || exit 2 +rcs -oOz $q a.c && rcs -l $q a.c && ci -k -u $q a.c && $diff a.kv a.c || { echo "#ci -k failed"; exit 1; } -sed '/^[^$]/d' a.kv >a.i && +sed -n 's/^[^$]*\$/$/p' a.kv >a.i && ident a.c >a.i1 && sed -e 1d -e 's/^[ ]*//' a.i1 >a.i2 && $diff a.i a.i2 || { echo "#ident failed"; exit 1; } rcs -i $q a.c 2>/dev/null && { echo "#rcs -i permitted existing file"; exit 1; } +rm -f a.c && co -l $q a.c && echo 2.2 >a.c && ci -mm $q a.c && @@ -259,39 +262,72 @@ rcs -nN:1.1 $q a.c && co -rN $q a.c && $diff a.11 a.c || { echo "#rcs -n failed"; exit 1; } +rm -f a.c && rcs -NN:2.1 $q a.c && co -rN $q a.c && -$diff a.kv a.c || { echo "#rcs -N failed"; exit 1; } +$diff a.N a.c || { echo "#rcs -N failed"; exit 1; } +rm -f a.c && co -l $q a.c && -rcs -c':::' $q a.c && -echo '$''Log$' >a.c && +echo ':::$''Log$' >a.c && ci -u -mm $q a.c && -test " `sed '$!d' a.c`" = ' :::' || { echo "#rcs -c failed"; exit 1; } +test " `sed '$!d' a.c`" = ' :::' || { echo "#comment leader failed"; exit 1; } +rm -f a.c && rcs -o2.2: $q a.c && co $q a.c && -$diff a.kv a.c || { echo "#rcs -o failed"; exit 1; } +$diff a.e a.c || { echo "#rcs -o failed"; exit 1; } -rcsdiff -r1.1 -r2.1 $q a.c >a.0 +rcsdiff -r1.1 -rOz $q a.c >a.0 case $? in 1) ;; *) echo "#rcsdiff bad status"; exit 1 esac -diff a.11 a.kv >a.1 +$DIFF a.11 a.kv >a.1 $diff a.0 a.1 || { echo "#rcsdiff failed"; exit 1; } rcs -l2.1 $q a.c || { echo "#rcs -l2.1 failed"; exit 1; } -for i in k kv kvl o v +for i in b k kv kvl o v do rm -f a.c && cp a.$i a.c && - rcsdiff -k$i $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; } + rcsdiff -k$i -rOz $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; } done co -p1.1 -ko $q a.c >a.t && $diff a.11 a.t || { echo "#co -p1.1 -ko failed"; exit 1; } rcs -u2.1 $q a.c || { echo "#rcs -u2.1 failed"; exit 1; } +rm -f a.c && +rcsclean $q a.c && +rcsclean -u $q a.c || { echo "#rcsclean botched a nonexistent file"; exit 1; } + +rm -f a.c && +co $q a.c && +rcsclean -n $q a.c && +rcsclean -n -u $q a.c && +test -f a.c || { echo "#rcsclean -n removed a file"; exit 1; } + +rm -f a.c && +co $q a.c && +rcsclean $q a.c && +test ! -f a.c || { echo "#rcsclean missed an unlocked file"; exit 1; } + +rm -f a.c && +co -l $q a.c && +rcsclean $q a.c && +test -f a.c || { echo "#rcsclean removed a locked file"; exit 1; } +rcsclean -u $q a.c && +test ! -f a.c || { + echo "#rcsclean -u missed an unchanged locked file"; exit 1; +} + +rm -f a.c && +co -l $q a.c && +echo change >>a.c && +rcsclean $q a.c && +rcsclean $q -u a.c && +test -f a.c || { echo "#rcsclean removed a changed file"; exit 1; } + rm -f a.c && co -l $q a.c && cat >a.c <<'EOF' @@ -324,7 +360,7 @@ b1 c d1 EOF -rcsmerge -r2.2 -r2.3 $q a.c +rcsmerge -E -r2.2 -r2.3 $q a.c case $? in 0) if $diff a.0 a.c >/dev/null @@ -343,16 +379,36 @@ case $? in echo "#rcsmerge bad status"; exit 1 esac -nl=' -' +# Avoid `tr' if possible; it's not portable, and it can't handle null bytes. +# Our substitute exclusive-ORs with '\n'; +# this ensures null bytes on output, which is even better than `tr', +# since some diffs think a file is binary only if it contains null bytes. +cat >a.c <<'EOF' +#include +int main() { + int c; + while ((c=getchar()) != EOF) + putchar(c ^ '\n'); + return 0; +} +EOF +tr=tr +if (rm -f a.exe a.out && $CL a.c $L >&2) >/dev/null 2>&1 +then + if test -s a.out + then tr=./a.out + elif test -s a.exe + then tr=./a.exe + fi +fi { - co -p $q a.c | tr "$nl" '\200' >a.24 && + co -p $q a.c | $tr '\012' '\200' >a.24 && cp a.24 a.c && ciOut=`(ci -l -mm $q a.c 2>&1)` && case $ciOut in ?*) echo >&2 "$ciOut" esac && - co -p $q a.c | tr '\200' "$nl" >a.c && + co -p $q a.c | $tr '\200' '\012' >a.c && rcsdiff -r2.3 $q a.c >/dev/null && echo 2.5 >a.c && @@ -378,15 +434,15 @@ locks: strict access list: symbolic names: N: 2.1 + Oz: 2.1 n: 1.8 -comment leader: ":::" keyword substitution: kv total revisions: 13; selected revisions: 1 description: 1.1 ---------------------------- revision 2.1 -date: $D $T; author: w; state: s; lines: +13 -1 +date: $date; author: w; state: s; lines: +14 -1 ============================================================================= EOF test $? = 0 || { echo "#rlog failed"; exit 1; } @@ -394,4 +450,5 @@ test $? = 0 || { echo "#rlog failed"; exit 1; } test ! -f $lockfile || { echo "#lock file not removed"; exit 1; } -exec rm -f a.* $RCSfile $RCS_alt +rm -f a.* $RCSfile $RCS_alt +$rmdir RCS