Here are the requests:
Root pathname \n
CVSROOT
to use.
Note that pathname is a local directory and not a fully
qualified CVSROOT
variable. pathname must
already exist; if creating a new root, use the init
request, not
Root
. pathname does not include the hostname of the
server, how to access the server, etc.; by the time the CVS protocol is
in use, connection, authentication, etc., are already taken care of.
The Root
request must be sent only once, and it must be sent
before any requests other than Valid-responses
,
valid-requests
, UseUnchanged
, or init
.
Valid-responses request-list \n
valid-requests \n
Valid-requests
response.
Directory local-directory \n
Entry
and Modified
and
also for ci
and the other commands; normal usage is to send
Directory
for each directory in which there will be an
Entry
or Modified
, and then a final Directory
for the original directory, then the command.
The local-directory is relative to
the top level at which the command is occurring (i.e. the last
Directory
which is sent before the command);
to indicate that top level, `.' should be sent for
local-directory.
Here is an example of where a client gets repository and
local-directory. Suppose that there is a module defined by
moddir 1dirThat is, one can check out
moddir
and it will take 1dir
in
the repository and check it out to moddir
in the working
directory. Then an initial check out could proceed like this:
C: Root /home/kingdon/zwork/cvsroot . . . C: Argument moddir C: Directory . C: /home/kingdon/zwork/cvsroot C: co S: Clear-sticky moddir/ S: /home/kingdon/zwork/cvsroot/1dir/ . . . S: okIn this example the response shown is
Clear-sticky
, but it could
be another response instead. Note that it returns two pathnames.
The first one, `moddir/', indicates the working
directory to check out into. The second one, ending in `1dir/',
indicates the directory to pass back to the server in a subsequent
Directory
request. For example, a subsequent update
request might look like:
C: Directory moddir C: /home/kingdon/zwork/cvsroot/1dir . . . C: updateFor a given local-directory, the repository will be the same for each of the responses, so one can use the repository from whichever response is most convenient. Typically a client will store the repository along with the sources for each local-directory, use that same setting whenever operating on that local-directory, and not update the setting as long as the local-directory exists. A client is free to rename a local-directory at any time (for example, in response to an explicit user request). While it is true that the server supplies a local-directory to the client, as noted above, this is only the default place to put the directory. Of course, the various
Directory
requests for a single command (for example,
update
or ci
request) should name a particular directory
with the same local-directory.
Each Directory
request specifies a brand-new
local-directory and repository; that is,
local-directory and repository are never relative to paths
specified in any previous Directory
request.
Max-dotdot level \n
Directory
requests are relative to will be
needed. For example, if the client is planning to use a
Directory
request for `../../foo', it must send a
Max-dotdot
request with a level of at least 2.
Max-dotdot
must be sent before the first Directory
request.
Static-directory \n
Directory
should not have
additional files checked out unless explicitly requested. The client
sends this if the Entries.Static
flag is set, which is controlled
by the Set-static-directory
and Clear-static-directory
responses.
Sticky tagspec \n
Directory
has a sticky tag or date tagspec.
The first character of tagspec is `T' for a tag, or `D'
for a date. The remainder of tagspec contains the actual tag or
date.
The server should remember Static-directory
and Sticky
requests for a particular directory; the client need not resend them
each time it sends a Directory
request for a given directory.
However, the server is not obliged to remember them beyond the context
of a single command.
Checkin-prog program \n
Directory
has a checkin program program.
Such a program would have been previously set with the
Set-checkin-prog
response.
Update-prog program \n
Directory
has an update program program.
Such a program would have been previously set with the
Set-update-prog
response.
Entry entry-line \n
Directory
. If the user
is operating on only some files in a directory, Entry
requests
for only those files need be included. If an Entry
request is
sent without Modified
, Is-modified
, or Unchanged
,
it means the file is
lost (does not exist in the working directory). If both Entry
and one of Modified
, Is-modified
, or Unchanged
are
sent for the same file, Entry
must be sent first. For a
given file, one can send Modified
, Is-modified
, or
Unchanged
, but not more than one of these three.
Kopt option \n
Modified
or Is-modified
request (for example `-kb' for a binary file). This is similar to
Entry
, but is used for a file for which there is no entries line.
Typically this will be a file being added via an add
or
import
request. The client may not send both Kopt
and
Entry
for the same file.
Modified filename \n
Directory
. If
the user is operating on only some files in a directory, only those
files need to be included. This can also be sent without Entry
,
if there is no entry for the file.
Is-modified filename \n
Modified
,
but used if the server only needs
to know whether the file is modified, not the contents.
The commands which can take Is-modified
instead of
Modified
with no known change in behavior are: admin
,
diff
(if and only if two `-r' or `-D' options are
specified), watch-on
, watch-off
, watch-add
,
watch-remove
, watchers
, editors
,
log
, and annotate
.
For the status
command, one can send Is-modified
but if
the client is using imperfect mechanisms such as timestamps to determine
whether to consider a file modified, then the behavior will be
different. That is, if one sends Modified
, then the server will
actually compare the contents of the file sent and the one it derives
from to determine whether the file is genuinely modified. But if one
sends Is-modified
, then the server takes the client's word for
it. A similar situation exists for tag
, if the `-c' option
is specified.
Commands for which Modified
is necessary are co
,
ci
, update
, and import
.
Commands which do not need to inform the server about a working
directory, and thus should not be sending either Modified
or
Is-modified
: rdiff
, rtag
, history
,
init
, and release
.
Commands for which further investigation is warranted are:
remove
, add
, and export
. Pending such
investigation, the more conservative course of action is to stick to
Modified
.
Unchanged filename \n
Directory
.
UseUnchanged \n
Notify filename \n
edit
or unedit
command has taken
place. The server needs to send a Notified
response, but such
response is deferred until the next time that the server is sending
responses. Response expected: no. Additional data:
notification-type \t time \t clienthost \t working-dir \t watches \nwhere notification-type is `E' for edit, `U' for unedit, undefined behavior if `C', and all other letters should be silently ignored for future expansion. time is the time at which the edit or unedit took place, in a user-readable format of the client's choice (the server should treat the time as an opaque string rather than interpreting it). clienthost is the name of the host on which the edit or unedit took place, and working-dir is the pathname of the working directory where the edit or unedit took place. watches are the temporary watches to set. If watches is followed by \t then the \t and the rest of the line should be ignored, for future expansion. Note that a client may be capable of performing an
edit
or
unedit
operation without connecting to the server at that time,
and instead connecting to the server when it is convenient (for example,
when a laptop is on the net again) to send the Notify
requests.
Even if a client is capable of deferring notifications, it should
attempt to send them immediately (one can send Notify
requests
together with a noop
request, for example), unless perhaps if
it can know that a connection would be impossible.
Questionable filename \n
M
response) `?' followed
by the directory and filename. filename must not contain
`/'; it needs to be a file in the directory named by the most
recent Directory
request.
Case \n
Entry
and Modified
requests for the
same file must match in case regardless of whether the Case
request is sent. The latter mechanism is more general (it could also be
used for 8.3 filenames, VMS filenames with more than one `.', and
any other situation in which there is a predictable mapping between
filenames in the working directory and filenames in the protocol), but
there are some situations it cannot handle (ignore patterns, or
situations where the user specifies a filename and the client does not
know about that file).
Argument text \n
Argumentx text \n
Global_option option \n
valid-requests
, it is probably better to
make new global options separate requests, rather than trying to add
them to this request.
Gzip-stream level \n
Kerberos-encrypt \n
Gzip-stream
and
the Kerberos-encrypt
requests are used, the
Kerberos-encrypt
request should be used first. This will make
the client and server encrypt the compressed data, as opposed to
compressing the encrypted data. Encrypted data is generally
incompressible.
Note that this request does not fully prevent an attacker from hijacking
the connection, in the sense that it does not prevent hijacking the
connection between the initial authentication and the
Kerberos-encrypt
request.
Gssapi-encrypt \n
Kerberos-encrypt
, above, for
the relation between Gssapi-encrypt
and Gzip-stream
.
Note that this request does not fully prevent an attacker from hijacking
the connection, in the sense that it does not prevent hijacking the
connection between the initial authentication and the
Gssapi-encrypt
request.
Gssapi-authenticate \n
Gssapi-authenticate
and Gssapi-encrypt
has no effect beyond that of
Gssapi-encrypt
. Unlike encrypted data, it is reasonable to
compress authenticated data.
Note that this request does not fully prevent an attacker from hijacking
the connection, in the sense that it does not prevent hijacking the
connection between the initial authentication and the
Gssapi-authenticate
request.
Set variable=value \n
expand-modules \n
Module-expansion
responses. Note
that the server can assume that this is checkout or export, not rtag or
rdiff; the latter do not access the working directory and thus have no
need to expand modules on the client side.
Expand may not be the best word for what this request does. It does not
necessarily tell you all the files contained in a module, for example.
Basically it is a way of telling you which working directories the
server needs to know about in order to handle a checkout of the
specified modules.
For example, suppose that the server has a module defined by
aliasmodule -a 1dirThat is, one can check out
aliasmodule
and it will take
1dir
in the repository and check it out to 1dir
in the
working directory. Now suppose the client already has this module
checked out and is planning on using the co
request to update it.
Without using expand-modules
, the client would have two bad
choices: it could either send information about all working
directories under the current directory, which could be unnecessarily
slow, or it could be ignorant of the fact that aliasmodule
stands
for 1dir
, and neglect to send information for 1dir
, which
would lead to incorrect operation.
With expand-modules
, the client would first ask for the module to
be expanded:
C: Root /home/kingdon/zwork/cvsroot . . . C: Argument aliasmodule C: Directory . C: /home/kingdon/zwork/cvsroot C: expand-modules S: Module-expansion 1dir S: okand then it knows to check the `1dir' directory and send requests such as
Entry
and Modified
for the files in that
directory.
ci \n
diff \n
tag \n
status \n
log \n
admin \n
history \n
watchers \n
editors \n
annotate \n
Argument
, Directory
, Entry
, or
Modified
requests, if they have been sent. The
last Directory
sent specifies the working directory at the time
of the operation. No provision is made for any input from the user.
This means that ci
must use a -m
argument if it wants to
specify a log message.
co \n
Argument
, Directory
, Entry
, or
Modified
requests, if they have been sent. Arguments to this
command are module names; the client cannot know what directories they
correspond to except by (1) just sending the co
request, and then
seeing what directory names the server sends back in its responses, and
(2) the expand-modules
request.
export \n
Argument
, Directory
, Entry
, or
Modified
requests, if they have been sent. Arguments to this
command are module names, as described for the co
request. The
intention behind this command is that a client can get sources from a
server without storing CVS information about those sources. That is, a
client probably should not count on being able to take the entries line
returned in the Created
response from an export
request
and send it in a future Entry
request. Note that the entries
line in the Created
response must indicate whether the file is
binary or text, so the client can create it correctly.
rdiff \n
rtag \n
Argument
requests, if they have been sent. The client
should not send Directory
, Entry
, or Modified
requests for this command; they are not used. Arguments to these
commands are module names, as described for co
.
init root-name \n
CVSROOT
variable. The
Root
request need not have been previously sent.
update \n
cvs update
command. This
uses any previous Argument
, Directory
, Entry
,
or Modified
requests, if they have been sent. The
last Directory
sent specifies the working directory at the time
of the operation. The -I
option is not used--files which the
client can decide whether to ignore are not mentioned and the client
sends the Questionable
request for others.
import \n
cvs import
command. This
uses any previous Argument
, Directory
, Entry
, or
Modified
requests, if they have been sent. The
last Directory
sent specifies the working directory at the time
of the operation. The files to be imported are sent in Modified
requests (files which the client knows should be ignored are not sent;
the server must still process the CVSROOT/cvsignore file unless -I ! is
sent). A log message must have been specified with a -m
argument.
add \n
Argument
, Directory
, Entry
, or
Modified
requests, if they have been sent. The
last Directory
sent specifies the working directory at the time
of the operation.
To add a directory, send the directory to be added using
Directory
and Argument
requests. For example:
C: Root /u/cvsroot . . . C: Argument nsdir C: Directory nsdir C: /u/cvsroot/1dir/nsdir C: Directory . C: /u/cvsroot/1dir C: add S: M Directory /u/cvsroot/1dir/nsdir added to the repository S: okYou will notice that the server does not signal to the client in any particular way that the directory has been successfully added. The client is supposed to just assume that the directory has been added and update its records accordingly. Note also that adding a directory is immediate; it does not wait until a
ci
request as files do.
To add a file, send the file to be added using a Modified
request. For example:
C: Argument nfile C: Directory . C: /u/cvsroot/1dir C: Modified nfile C: u=rw,g=r,o=r C: 6 C: hello C: add S: E cvs server: scheduling file `nfile' for addition S: Mode u=rw,g=r,o=r S: Checked-in ./ S: /u/cvsroot/1dir/nfile S: /nfile/0/// S: E cvs server: use 'cvs commit' to add this file permanently S: okNote that the file has not been added to the repository; the only effect of a successful
add
request, for a file, is to supply the client
with a new entries line containing `0' to indicate an added file.
In fact, the client probably could perform this operation without
contacting the server, although using add
does cause the server
to perform a few more checks.
The client sends a subsequent ci
to actually add the file to the
repository.
Another quirk of the add
request is that with CVS 1.9 and older,
a pathname specified in
an Argument
request cannot contain `/'. There is no good
reason for this restriction, and in fact more recent CVS servers don't
have it.
But the way to interoperate with the older servers is to ensure that
all Directory
requests for add
(except those used to add
directories, as described above), use `.' for
local-directory. Specifying another string for
local-directory may not get an error, but it will get you strange
Checked-in
responses from the buggy servers.
remove \n
Argument
, Directory
, Entry
, or
Modified
requests, if they have been sent. The
last Directory
sent specifies the working directory at the time
of the operation.
Note that this request does not actually do anything to the repository;
the only effect of a successful remove
request is to supply the
client with a new entries line containing `-' to indicate a removed
file. In fact, the client probably could perform this operation without
contacting the server, although using remove
may cause the server
to perform a few more checks.
The client sends a subsequent ci
request to actually record the
removal in the repository.
watch-on \n
watch-off \n
watch-add \n
watch-remove \n
cvs watch on
, cvs
watch off
, cvs watch add
, and cvs watch remove
commands,
respectively. This uses any previous Argument
,
Directory
, Entry
, or Modified
requests, if they have been sent. The last Directory
sent
specifies the working directory at the time of the operation.
release \n
cvs release
command has
taken place and update the history file accordingly.
noop \n
Notified
responses, etc.
update-patches \n
update
request. The client must issue the -u
argument to update
in order to receive patches.
gzip-file-contents level \n
Gzip-stream
is suggested
instead of gzip-file-contents
as it gives better compression; the
only reason to implement the latter is to provide compression with
CVS 1.8 and earlier. The gzip-file-contents
request asks
the server to compress files it sends to the client using gzip
(RFC1952/1951) compression, using the specified level of compression.
If this request is not made, the server must not compress files.
This is only a hint to the server. It may still decide (for example, in
the case of very small files, or files that already appear to be
compressed) not to do the compression. Compression is indicated by a
`z' preceding the file length.
Availability of this request in the server indicates to the client that
it may compress files sent to the server, regardless of whether the
client actually uses this request.
wrapper-sendme-rcsOptions \n
Wrapper-rcsOption
responses.
other-request text \n
When the client is done, it drops the connection.
Go to the first, previous, next, last section, table of contents.