xref: /openbsd/usr.bin/rcs/co.1 (revision 5af055cd)
1.\"	$OpenBSD: co.1,v 1.29 2010/09/03 11:09:29 jmc Exp $
2.\"
3.\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
4.\" All rights reserved.
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.Dd $Mdocdate: September 3 2010 $
18.Dt CO 1
19.Os
20.Sh NAME
21.Nm co
22.Nd check out RCS revisions
23.Sh SYNOPSIS
24.Nm
25.Bk -words
26.Op Fl TV
27.Op Fl d Ns Ar date
28.Op Fl f Ns Op Ar rev
29.Op Fl I Ns Op Ar rev
30.Op Fl k Ns Ar mode
31.Op Fl l Ns Op Ar rev
32.Op Fl M Ns Op Ar rev
33.Op Fl p Ns Op Ar rev
34.Op Fl q Ns Op Ar rev
35.Op Fl r Ns Op Ar rev
36.Op Fl s Ns Ar state
37.Op Fl u Ns Op Ar rev
38.Op Fl w Ns Op Ar user
39.Op Fl x Ns Ar suffixes
40.Op Fl z Ns Ar tz
41.Ar
42.Ek
43.Sh DESCRIPTION
44The
45.Nm
46program is used to check out revisions from RCS files.
47.Pp
48When a file is checked out,
49a copy is taken from the RCS repository,
50minus its RCS information,
51and placed in the current working directory.
52Files may be checked out as the most recent revision
53or according to a specific revision,
54using the
55.Fl r
56option.
57.Pp
58Files are checked out in one of two possible modes:
59unlocked (the default) or locked (using the
60.Fl l
61option).
62In unlocked mode, any user may check out the file for reading.
63If changes are to be made to a file though,
64it will have to be locked using the
65.Fl l
66option.
67During this time,
68no other users may check out the file whilst it is locked.
69.Pp
70.Nm
71also supports
72keyword substitution \(en
73see the
74.Xr rcs 1
75man page for more information.
76.Pp
77The following options are supported:
78.Bl -tag -width Ds
79.It Fl d Ns Ar date
80Retrieve revision as of the latest revision no later than
81.Ar date .
82.It Fl f Ns Op Ar rev
83Force the overwriting of the working file.
84.It Fl I Ns Op Ar rev
85Interactive mode.
86.It Fl k Ns Ar mode
87Specify the keyword substitution mode.
88.It Fl l Ns Op Ar rev
89The same as
90.Fl r ,
91but also locks the revision.
92.It Fl M Ns Op Ar rev
93Set the modification time of the file to the date of the
94retrieved revision.
95.It Fl p Ns Op Ar rev
96Print the latest revision no later than
97.Ar rev
98to standard output.
99.It Fl q Ns Op Ar rev
100Be quiet about reporting.
101.It Fl r Ns Op Ar rev
102Retrieve the latest revision no later than
103.Ar rev .
104.It Fl s Ns Ar state
105Retrieve revision of the specified
106.Ar state
107only.
108.It Fl T
109Preserve the modification time of RCS files.
110.It Fl u Ns Op Ar rev
111The same as
112.Fl r ,
113but also unlocks the retrieved revision if it was locked.
114.It Fl V
115Print RCS's version number.
116.It Fl w Ns Op Ar user
117Retrieve the latest revision which was checked in by the specified
118.Ar user .
119If the
120.Ar user
121argument is omitted, the login of the user issuing the command
122is assumed.
123.It Fl x Ns Ar suffixes
124Specifies the suffixes for RCS files.
125Suffixes should be separated by the
126.Sq /
127character.
128.It Fl z Ns Ar tz
129Specify the date output format in keyword substitution, and the
130default time zone for
131.Ar date
132used in the
133.Fl d
134option.
135.El
136.Sh ENVIRONMENT
137.Bl -tag -width RCSINIT
138.It Ev RCSINIT
139If set, this variable should contain a list of space-delimited options that
140are prepended to the argument list.
141.El
142.Sh EXIT STATUS
143.Ex -std co
144.Sh EXAMPLES
145Retrieve the latest revision of file
146.Pa foo.c
147and lock it for further editing:
148.Pp
149.Dl $ co -l foo.c
150.Pp
151Retrieve revision 1.5 of file
152.Pa foo.c :
153.Pp
154.Dl $ co -r1.5 foo.c
155.Sh SEE ALSO
156.Xr ci 1 ,
157.Xr ident 1 ,
158.Xr rcs 1 ,
159.Xr rcsclean 1 ,
160.Xr rcsdiff 1 ,
161.Xr rcsmerge 1 ,
162.Xr rlog 1
163