Penguin
Annotated edit history of co(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 CO
2 !!!CO
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 KEYWORD SUBSTITUTION
8 FILE MODES
9 FILES
10 ENVIRONMENT
11 DIAGNOSTICS
12 IDENTIFICATION
13 SEE ALSO
14 LIMITS
15 ----
16 !!NAME
17
18
19 co - check out RCS revisions
20 !!SYNOPSIS
21
22
23 __co__ [[''options''] ''file'' ...
24 !!DESCRIPTION
25
26
27 __co__ retrieves a revision from each RCS
28 file and stores it into the corresponding working
29 file.
30
31
32 Pathnames matching an RCS suffix denote
33 RCS files; all others denote working files.
34 Names are paired as explained in ci(1).
35
36
37 Revisions of an RCS file can be checked out
38 locked or unlocked. Locking a revision prevents overlapping
39 updates. A revision checked out for reading or processing
40 (e.g., compiling) need not be locked. A revision checked out
41 for editing and later checkin must normally be locked.
42 Checkout with locking fails if the revision to be checked
43 out is currently locked by another user. (A lock can be
44 broken with rcs(1).) Checkout with locking also
45 requires the caller to be on the access list of the
46 RCS file, unless he is the owner of the file
47 or the superuser, or the access list is empty. Checkout
48 without locking is not subject to accesslist restrictions,
49 and is not affected by the presence of locks.
50
51
52 A revision is selected by options for revision or branch
53 number, checkin date/time, author, or state. When the
54 selection options are applied in combination, __co__
55 retrieves the latest revision that satisfies all of them. If
56 none of the selection options is specified, __co__
57 retrieves the latest revision on the default branch
58 (normally the trunk, see the __-b__ option of
59 rcs(1)). A revision or branch number can be attached
60 to any of the options __-f__, __-I__, __-l__,
61 __-M__, __-p__, __-q__, __-r__, or __-u__.
62 The options __-d__ (date), __-s__ (state), and
63 __-w__ (author) retrieve from a single branch, the
64 ''selected'' branch, which is either specified by one of
65 __-f__, ..., __-u__, or the default
66 branch.
67
68
69 A __co__ command applied to an RCS file
70 with no revisions creates a zero-length working file.
71 __co__ always performs keyword substitution (see
72 below).
73 !!OPTIONS
74
75
76 __-r__[[''rev'']
77
78
79 retrieves the latest revision whose number is less than or
80 equal to ''rev''. If ''rev'' indicates a branch rather
81 than a revision, the latest revision on that branch is
82 retrieved. If ''rev'' is omitted, the latest revision on
83 the default branch (see the __-b__ option of
84 rcs(1)) is retrieved. If ''rev'' is __$__,
85 __co__ determines the revision number from keyword values
86 in the working file. Otherwise, a revision is composed of
87 one or more numeric or symbolic fields separated by periods.
88 If ''rev'' begins with a period, then the default branch
89 (normally the trunk) is prepended to it. If ''rev'' is a
90 branch number followed by a period, then the latest revision
91 on that branch is used. The numeric equivalent of a symbolic
92 field is specified with the __-n__ option of the commands
93 ci(1) and rcs(1).
94
95
96 __-l__[[''rev'']
97
98
99 same as __-r__, except that it also locks the retrieved
100 revision for the caller.
101
102
103 __-u__[[''rev'']
104
105
106 same as __-r__, except that it unlocks the retrieved
107 revision if it was locked by the caller. If ''rev'' is
108 omitted, __-u__ retrieves the revision locked by the
109 caller, if there is one; otherwise, it retrieves the latest
110 revision on the default branch.
111
112
113 __-f__[[''rev'']
114
115
116 forces the overwriting of the working file; useful in
117 connection with __-q__. See also FILE
118 MODES below.
119
120
121 __-kkv__
122
123
124 Generate keyword strings using the default form, e.g.
125 __$Revision: 5.13 $__ for the __Revision__ keyword. A
126 locker's name is inserted in the value of the __Header__,
127 __Id__, and __Locker__ keyword strings only as a file
128 is being locked, i.e. by __ci -l__ and __co -l__. This
129 is the default.
130
131
132 __-kkvl__
133
134
135 Like __-kkv__, except that a locker's name is always
136 inserted if the given revision is currently
137 locked.
138
139
140 __-kk__
141
142
143 Generate only keyword names in keyword strings; omit their
144 values. See KEYWORD SUBSTITUTION below. For
145 example, for the __Revision__ keyword, generate the
146 string __$Revision$__ instead of __$Revision: 5.13
147 $__. This option is useful to ignore differences due to
148 keyword substitution when comparing different revisions of a
149 file. Log messages are inserted after __$Log$__ keywords
150 even if __-kk__ is specified, since this tends to be more
151 useful when merging changes.
152
153
154 __-ko__
155
156
157 Generate the old keyword string, present in the working file
158 just before it was checked in. For example, for the
159 __Revision__ keyword, generate the string __$Revision:
160 1.1 $__ instead of __$Revision: 5.13 $__ if that is how
161 the string appeared when the file was checked in. This can
162 be useful for file formats that cannot tolerate any changes
163 to substrings that happen to take the form of keyword
164 strings.
165
166
167 __-kb__
168
169
170 Generate a binary image of the old keyword string. This acts
171 like __-ko__, except it performs all working file input
172 and output in binary mode. This makes little difference on
173 Posix and Unix hosts, but on DOS-like hosts one should use
174 __rcs -i -kb__ to initialize an RCS file
175 intended to be used for binary files. Also, on all hosts,
176 rcsmerge(1) normally refuses to merge files when
177 __-kb__ is in effect.
178
179
180 __-kv__
181
182
183 Generate only keyword values for keyword strings. For
184 example, for the __Revision__ keyword, generate the
185 string __5.13__ instead of __$Revision: 5.13 $__. This
186 can help generate files in programming languages where it is
187 hard to strip keyword delimiters like __$Revision: $__
188 from a string. However, further keyword substitution cannot
189 be performed once the keyword names are removed, so this
190 option should be used with care. Because of this danger of
191 losing keywords, this option cannot be combined with
192 __-l__, and the owner write permission of the working
193 file is turned off; to edit the file later, check it out
194 again without __-kv__.
195
196
197 __-p__[[''rev'']
198
199
200 prints the retrieved revision on the standard output rather
201 than storing it in the working file. This option is useful
202 when __co__ is part of a pipe.
203
204
205 __-q__[[''rev'']
206
207
208 quiet mode; diagnostics are not printed.
209
210
211 __-I__[[''rev'']
212
213
214 interactive mode; the user is prompted and questioned even
215 if the standard input is not a terminal.
216
217
218 __-d__''date''
219
220
221 retrieves the latest revision on the selected branch whose
222 checkin date/time is less than or equal to ''date''. The
223 date and time can be given in free format. The time zone
224 __LT__ stands for local time; other common time zone
225 names are understood. For example, the following
226 ''date''s are equivalent if local time is January 11,
227 1990, 8pm Pacific Standard Time, eight hours west of
228 Coordinated Universal Time ( UTC
229 ):
230
231
232 __8:00 pm lt
233 4:00 AM, Jan. 12, 1990__ default is UTC
234 __1990-01-12 04:00:00+00__ ISO 8601 (UTC)
235 __1990-01-11 20:00:00-08__ ISO 8601 (local time)
236 __1990/01/12 04:00:00__ traditional RCS format
237 __Thu Jan 11 20:00:00 1990 LT__ output of ctime(3) + __LT
238 Thu Jan 11 20:00:00 PST 1990__ output of date(1)
239 __Fri Jan 12 04:00:00 GMT 1990
240 Thu, 11 Jan 1990 20:00:00 -0800__ Internet RFC 822
241 __12-January-1990, 04:00 WET
242 __
243
244
245 Most fields in the date and time can be defaulted. The
246 default time zone is normally UTC , but this
247 can be overridden by the __-z__ option. The other
248 defaults are determined in the order year, month, day, hour,
249 minute, and second (most to least significant). At least one
250 of these fields must be provided. For omitted fields that
251 are of higher significance than the highest provided field,
252 the time zone's current values are assumed. For all other
253 omitted fields, the lowest possible values are assumed. For
254 example, without __-z__, the date __20, 10:30__
255 defaults to 10:30:00 UTC of the 20th of the
256 UTC time zone's current month and year. The
257 date/time must be quoted if it contains spaces.
258
259
260 __-M__[[''rev'']
261
262
263 Set the modification time on the new working file to be the
264 date of the retrieved revision. Use this option with care;
265 it can confuse make(1).
266
267
268 __-s__''state''
269
270
271 retrieves the latest revision on the selected branch whose
272 state is set to ''state''.
273
274
275 __-T__
276
277
278 Preserve the modification time on the RCS
279 file even if the RCS file changes because a
280 lock is added or removed. This option can suppress extensive
281 recompilation caused by a make(1) dependency of some
282 other copy of the working file on the RCS
283 file. Use this option with care; it can suppress
284 recompilation even when it is needed, i.e. when the change
285 of lock would mean a change to keyword strings in the other
286 working file.
287
288
289 __-w__[[''login'']
290
291
292 retrieves the latest revision on the selected branch which
293 was checked in by the user with login name ''login''. If
294 the argument ''login'' is omitted, the caller's login is
295 assumed.
296
297
298 __-j__''joinlist''
299
300
301 generates a new revision which is the join of the revisions
302 on ''joinlist''. This option is largely obsoleted by
303 rcsmerge(1) but is retained for backwards
304 compatibility.
305
306
307 The ''joinlist'' is a comma-separated list of pairs of
308 the form ''rev2''__:__''rev3,'' where ''rev2''
309 and ''rev3'' are (symbolic or numeric) revision numbers.
310 For the initial such pair, ''rev1'' denotes the revision
311 selected by the above options __-f__, ..., __-w__. For
312 all other pairs, ''rev1'' denotes the revision generated
313 by the previous pair. (Thus, the output of one join becomes
314 the input to the next.)
315
316
317 For each pair, __co__ joins revisions ''rev1'' and
318 ''rev3'' with respect to ''rev2''. This means that all
319 changes that transform ''rev2'' into ''rev1'' are
320 applied to a copy of ''rev3''. This is particularly
321 useful if ''rev1'' and ''rev3'' are the ends of two
322 branches that have ''rev2'' as a common ancestor. If
323 ''rev1''''rev2''''rev3'' on the same
324 branch, joining generates a new revision which is like
325 ''rev3,'' but with all changes that lead from ''rev1''
326 to ''rev2'' undone. If changes from ''rev2'' to
327 ''rev1'' overlap with changes from ''rev2'' to
328 ''rev3,'' __co__ reports overlaps as described in
329 merge(1).
330
331
332 For the initial pair, ''rev2'' can be omitted. The
333 default is the common ancestor. If any of the arguments
334 indicate branches, the latest revisions on those branches
335 are assumed. The options __-l__ and __-u__ lock or
336 unlock ''rev1''.
337
338
339 __-V__
340
341
342 Print RCS 's version number.
343
344
345 __-V__''n''
346
347
348 Emulate RCS version ''n,'' where ''n''
349 can be __3__, __4__, or __5__. This can be useful
350 when interchanging RCS files with others who
351 are running older versions of RCS . To see
352 which version of RCS your correspondents are
353 running, have them invoke __rcs -V__; this works with
354 newer versions of RCS . If it doesn't work,
355 have them invoke __rlog__ on an RCS file;
356 if none of the first few lines of output contain the string
357 __branch:__ it is version 3; if the dates' years have
358 just two digits, it is version 4; otherwise, it is version
359 5. An RCS file generated while emulating
360 version 3 loses its default branch. An RCS
361 revision generated while emulating version 4 or earlier has
362 a time stamp that is off by up to 13 hours. A revision
363 extracted while emulating version 4 or earlier contains
364 abbreviated dates of the form
365 ''yy''__/__''mm''__/__''dd'' and can also
366 contain different white space and line prefixes in the
367 substitution for __$Log$__.
368
369
370 __-x__''suffixes''
371
372
373 Use ''suffixes'' to characterize RCS
374 files. See ci(1) for details.
375
376
377 __-z__''zone''
378
379
380 specifies the date output format in keyword substitution,
381 and specifies the default time zone for ''date'' in the
382 __-d__''date'' option. The ''zone'' should be
383 empty, a numeric UTC offset, or the special
384 string __LT__ for local time. The default is an empty
385 ''zone'', which uses the traditional RCS
386 format of UTC without any time zone
387 indication and with slashes separating the parts of the
388 date; otherwise, times are output in ISO 8601
389 format with time zone indication. For example, if local time
390 is January 11, 1990, 8pm Pacific Standard Time, eight hours
391 west of UTC , then the time is output as
392 follows:
393
394
395 ''option time output
396 ''__-z 1990/01/12 04:00:00__ '' (default)
397 ''__-zLT 1990-01-11 20:00:00-08
398 -z+05:30 1990-01-12 09:30:00+05:30
399 __
400
401
402 The __-z__ option does not affect dates stored in
403 RCS files, which are always
404 UTC .
405 !!KEYWORD SUBSTITUTION
406
407
408 Strings of the form __$__''keyword''__$__ and
409 __$__''keyword''__:__''...''__$__ embedded in
410 the text are replaced with strings of the form
411 __$__''keyword''__:__''value''__$__ where
412 ''keyword'' and ''value'' are pairs listed below.
413 Keywords can be embedded in literal strings or comments to
414 identify a revision.
415
416
417 Initially, the user enters strings of the form
418 __$__''keyword''__$__''.'' On checkout,
419 __co__ replaces these strings with strings of the form
420 __$__''keyword''__:__''value''__$__''.''
421 If a revision containing strings of the latter form is
422 checked back in, the value fields will be replaced during
423 the next checkout. Thus, the keyword values are
424 automatically updated on checkout. This automatic
425 substitution can be modified by the __-k__
426 options.
427
428
429 Keywords and their corresponding values:
430
431
432 __$Author$__
433
434
435 The login name of the user who checked in the
436 revision.
437
438
439 __$Date$__
440
441
442 The date and time the revision was checked in. With
443 __-z__''zone'' a numeric time zone offset is appended;
444 otherwise, the date is UTC .
445
446
447 __$Header$__
448
449
450 A standard header containing the full pathname of the
451 RCS file, the revision number, the date and
452 time, the author, the state, and the locker (if locked).
453 With __-z__''zone'' a numeric time zone offset is
454 appended to the date; otherwise, the date is
455 UTC .
456
457
458 __$Id$__
459
460
461 Same as __$Header$__, except that the RCS
462 filename is without a path.
463
464
465 __$Locker$__
466
467
468 The login name of the user who locked the revision (empty if
469 not locked).
470
471
472 __$Log$__
473
474
475 The log message supplied during checkin, preceded by a
476 header containing the RCS filename, the
477 revision number, the author, and the date and time. With
478 __-z__''zone'' a numeric time zone offset is appended;
479 otherwise, the date is UTC . Existing log
480 messages are ''not'' replaced. Instead, the new log
481 message is inserted after __$Log:__...__$__. This is
482 useful for accumulating a complete change log in a source
483 file.
484
485
486 Each inserted line is prefixed by the string that prefixes
487 the __$Log$__ line. For example, if the __$Log$__ line
488 is ``__// $Log: tan.cc $__'', RCS prefixes
489 each line of the log with ``__//__ ''. This is useful for
490 languages with comments that go to the end of the line. The
491 convention for other languages is to use a `` '' prefix
492 inside a multiline comment. For example, the initial log
493 comment of a C program conventionally is of the following
494 form:
495
496
497 __/
498 $Log$
499 /
500 __
501
502
503 For backwards compatibility with older versions of
504 RCS , if the log prefix is __/__ or
505 __(__ surrounded by optional white space, inserted log
506 lines contain a space instead of __/__ or __(__;
507 however, this usage is obsolescent and should not be relied
508 on.
509
510
511 __$Name$__
512
513
514 The symbolic name used to check out the revision, if any.
515 For example, __co -rJoe__ generates __$Name: Joe $__.
516 Plain __co__ generates just __$Name: $__.
517
518
519 __$RCSfile$__
520
521
522 The name of the RCS file without a
523 path.
524
525
526 __$Revision$__
527
528
529 The revision number assigned to the revision.
530
531
532 __$Source$__
533
534
535 The full pathname of the RCS
536 file.
537
538
539 __$State$__
540
541
542 The state assigned to the revision with the __-s__ option
543 of rcs(1) or ci(1).
544
545
546 The following characters in keyword values are represented
547 by escape sequences to keep keyword strings
548 well-formed.
549
550
551 ''char escape sequence
552 ''tab __ t
553 __newline __ n
554 __space __ 040
555 $ 044
556 \ \
557 __
558 !!FILE MODES
559
560
561 The working file inherits the read and execute permissions
562 from the RCS file. In addition, the owner
563 write permission is turned on, unless __-kv__ is set or
564 the file is checked out unlocked and locking is set to
565 strict (see rcs(1)).
566
567
568 If a file with the name of the working file exists already
569 and has write permission, __co__ aborts the checkout,
570 asking beforehand if possible. If the existing working file
571 is not writable or __-f__ is given, the working file is
572 deleted without asking.
573 !!FILES
574
575
576 __co__ accesses files much as ci(1) does, except
577 that it does not need to read the working file unless a
578 revision number of __$__ is specified.
579 !!ENVIRONMENT
580
581
582 __RCSINIT__
583
584
585 options prepended to the argument list, separated by spaces.
586 See ci(1) for details.
587 !!DIAGNOSTICS
588
589
590 The RCS pathname, the working pathname, and
591 the revision number retrieved are written to the diagnostic
592 output. The exit status is zero if and only if all
593 operations were successful.
594 !!IDENTIFICATION
595
596
597 Author: Walter F. Tichy.
598 Manual Page Revision: 5.13; Release Date: 1995/06/01.
599 Copyright 1982, 1988, 1989 Walter F. Tichy.
600 Copyright 1990, 1991, 1992, 1993, 1994, 1995 Paul
601 Eggert.
602 !!SEE ALSO
603
604
605 rcsintro(1), ci(1), ctime(3), date(1), ident(1), make(1),
606 rcs(1), rcsclean(1), rcsdiff(1), rcsmerge(1), rlog(1),
607 rcsfile(5)
608 Walter F. Tichy, RCS --A System for Version
609 Control, ''Software--Practice ''
610 __15__, 7 (July 1985), 637-654.
611 !!LIMITS
612
613
614 Links to the RCS and working files are not
615 preserved.
616
617
618 There is no way to selectively suppress the expansion of
619 keywords, except by writing them differently. In nroff and
620 troff, this is done by embedding the null-character
621 ____ into the keyword.
622 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.