$Id: Protocol,v 1.23 2003/03/04 19:26:13 jdp Exp $ Copyright 1999-2003 John D. Polstra This document describes protocol version 15.6. General conventions: Commands consist of text lines which are generally readable by humans. Tokens in commands are separated by white space. Tokens containing embedded white space employ the following escape conventions: \_ = space \t = tab \n = newline \r = carriage return \\ = backslash Start-up (active mode): Client Server ------ ------ OK PROTO PROTO USER OK ATTR ... . ATTR ... . COLL REF ... ACC ... . ... . COLL PRFX . ... . PORT [server connects to the given endpoint] Shutdown: Client Server ------ ------ [close wrA] [close wrB] [wait for EOF on rdA] [wait for EOF on rdB] [close wrA] [close wrB] [wait for EOF on rdA] [wait for EOF on rdB] Tree Lister -> Tree Differ: D Go down one directory level into . F The file is live on the client, and the RCS file's attributes are . f The file is dead on the client, and the RCS file's attributes are . U Go up one directory level. The attributes of the directory being exited are . Tree Differ -> Detailer: D File should be deleted. I Create a new directory named , and add its DirDown entry to the list file. CVS mode only. i Remove the DirDown list file entry for the directory . CVS mode only. J Set the attributes for directory to , and update its DirUp list file entry. CVS mode only. j Remove the directory , and delete its DirUp list file entry. CVS mode only. H Create a hard link named which is a link to , if such a link does not already exist live. CVS mode only. h Create a hard link named which is a link to , if such a link does not already exist dead. CVS mode only. T File should be updated, unless it exists live and has attributes of . CVS mode only. t File should be updated, unless it exists dead and has attributes of . CVS mode only. U File should be added or updated. Detailer -> File Differ: A Send the entire file . C Check out the specified version of and send it in its entirety. Checkout mode only. D File should be deleted. H Create a hard link named which is a link to , if such a link does not already exist live. CVS mode only. h Create a hard link named which is a link to , if such a link does not already exist dead. CVS mode only. I Create a new directory named , and add its DirDown entry to the list file. CVS mode only. i Remove the DirDown list file entry for the directory . CVS mode only. J Set the attributes for directory to , and update its DirUp list file entry. CVS mode only. j Remove the directory , and delete its DirUp list file entry. CVS mode only. L File is live and up to date, but its list file entry needs to be updated to . CVS mode only. l File is dead and up to date, but its list file entry needs to be updated to . CVS mode only. N File exists as a node on the client, i.e., as something other than a regular file. CVS mode only. (* FIXME - really CVS mode only? *) R Update the regular file that has size and checksum on the client. r Use the rsync algorithm to update . The file is bytes in length on the client. The file is divided into ceiling(/) blocks. Each block, except possibly the last one, has size . The details of the client's file follow: The 32-bit rolling checksum and the 64-bit md5 checksum, in hexadecimal, for one block. There is one such line for each block of the client's file, including any partial final block. That's ceiling(/) lines total. . End of client's file details. S Update the existing checked out file to the specified version. The version of the existing file is not known, but its checksum is . Checkout mode only. s Update the existing checked out file to the specified version. The client is believed to have version of the file, and the client file's md5 checksum is . This command is used when updating a file that was last updated by an older version of CVSup, which didn't yet record revDates in the "checkouts" files. Checkout mode only. U Update the existing checked out file to the specified version. The client currently has version of the file. The date associated with the revision in the RCS file should be . Checkout mode only. V Update the RCS file . CVS mode only. The details of the client's version follow: B Default branch is . b Default branch is empty. D List of client deltas follows: Client has a delta with the date . . End of delta list. E Default keyword expansion is . T List of client tags follows: Client has a tag :. . End of tag list. . End of client RCS file details. X Send the entire file as a fixup. CVS mode only. Y Send the specified version of the file in its entirety, as a fixup. Checkout mode only. File Differ -> Updater: A Receive the entire file , and set its attributes to . The file data follows verbatim, with the number of bytes given by the size specified in the attributes. After the data comes a line containing one of the following: . The file was sent successfully. .< The file unexpectedly got shorter. The data sent was padded with NUL characters. Finally there is a line specifying what the final MD5 checksum of the updated file should be: 5 Note: If the file grew during the transfer, the extra characters are simply ignored until the next time an update is performed. a Identical to "A", but put the file in the Attic. CVS mode only. C Receive an entire checked out version of . Its revision number is , and it corresponds to the version specified by and . The date of the delta is . The corresponding RCS file has attributes of . Checkout mode only. The text of the checked out version follows, with any leading "." on a line transformed into "..". The text is terminated by a line containing one of the following: . End of the text. .+ End of the text, but suppress the newline at the end of the last line. Finally there is a line specifying what the final MD5 checksum of the updated file should be: 5 c Note that the specified version of is dead. The corresponding RCS file has attributes of . Checkout mode only. D Delete the specified file, whether it is checked out, live, or in the Attic. E [] Append to the list of shell commands to be executed after the next file update, if the update is successful. may contain "%s" escapes, which will be replaced by the pathname of on the client. is exactly the name of the affected file, relative to the prefix directory; if the file is checked out or in the Attic, that is already reflected in the name. Note that any "E" commands immediately precede the associated file update command for . The client defers executing them until the file update has succeeded. H Create a hard link named which is a link to , if such a link does not already exist live. CVS mode only. h Create a hard link named which is a link to , if such a link does not already exist dead. CVS mode only. I Create a new directory named , and add its DirDown entry to the list file. CVS mode only. i Remove the DirDown list file entry for the directory . CVS mode only. J Set the attributes for directory to , and update its DirUp list file entry. CVS mode only. j Remove the directory , and delete its DirUp list file entry. CVS mode only. L Update the list file information for the live RCS file . CVS mode only. l Update the list file information for the dead RCS file . CVS mode only. N Create or update a node with attributes . CVS mode only n Like "N" except that the node is in the Attic. CVS mode only. R Like "A" except that the file already exists on the client. r Edit the using the rsync algorithm with a block size of , and set its attributes to . After editing, the file's MD5 checksum should be . The rsync directives to construct the new version of the file follow: First comes some text, escaped and terminated as described under the "C" command, to write to the beginning of the file. Next comes 0 or more chunks, each describing a range of consecutive blocks from the original file to copy to the end of the new file, and some text to write after that. In each chunk, the block range comes first, followed by the escaped text: Copy rsync blocks from the original file, beginning with block number . Blocks are numbered from 0. Text, escaped as described under the "C" command. Finally comes the end marker: . End of rsync directives. T Update the list file information for the live checked out file . The client's version has revision number , which corresponds to the version specified by and . The date associated with the delta is . The corresponding RCS file has attributes of . Checkout mode only. U Edit the live checked out file to bring it up to date for and . The revision number that the client initially has is . is "1" or "0", depending on whether the RCS file is in the Attic. specifies the number of "Log" keyword lines that need to be deleted before editing, in order to unexpand that keyword properly. specifies the RCS keyword expansion mode that should be used. gives the attributes of the corresponding RCS file. After editing, the checked out file should have a checksum of . Checkout mode only. The editing commands follow: D Add a delta. See the description under the "V" command. . End of editing commands. u Delete the checked out file , because it has become dead. Update the list file to note that the client is current for have the version specified by and , and that the RCS file's attributes are . Checkout mode only. V Edit the RCS file , make it live, and set its attributes to . specifies some details of the RCS file format. After editing, the RCS file should have a checksum of . CVS mode only. The editing commands follow: B Set the default branch to . b Clear the default branch. D Add a delta to produce revision . is the revision number that the diffs must be applied to, in order to produce the new revision. If is ".", then the full text of the new revision is attached, rather than a set of diffs. and specify the date and author of the new revision. The text associated with the delta follows: L The log text follows, with any leading "." in a line transformed into "..". The log text is terminated as described for the "C" command. N Append a "newphrase" with the given key to the newphrases associated with the delta tree. The words of the newphrase follow: W Append the word to the newphrase. S Append a string to the newphrase. The string follows, with any leading "." in a line transformed into "..". The string is terminated as described for the "C" command. . End of the "newphrase". n Like "N", but the newphrases are associated with the text of the delta, rather than with the tree. S Set the state of the revision to . T The delta text follows, with any leading "." in a line transformed into "..". The delta text is terminated as described for the "C" command. The delta text is a set of diffs relative to , or the full text if is ".". . End of the delta. d Delete the specified revision. E Change the default RCS keyword expansion mode to . T Add a new tag :. t Delete the tag :. . End of editing commands. v Like "V", but put the file in the Attic after editing it. CVS mode only. X Receive the live RCS file in its entirety, as a fixup. Set its attributes to . The data follows, in the same format as for the "A" command. CVS mode only. x Like "X", but put the file into the Attic. CVS mode only. Y Receive a checked out version of in its entirety, as a fixup. The received version has revision number , which corresponds to and . The date of the revision is , and the corresponding RCS file has attributes of . The contents of the revision follow, in the same form as for the "C" command. Checkout mode only. Z Append some new data to the end of the existing file , and set its attributes to . The data should be written to the file starting at file offset , which should be exactly at the end of the file. Exactly n bytes of data follow, where n is the size attribute minus . After the data comes a terminating line, as in the "A" command. The number of bytes n can be 0, in which case the file's attributes are simply updated. ! Log the given warning message from the server.