Technical Differences Between the GNU CVS Client and MacCVS Pro
Please note: This document will be changed significantly when MacCVS Pro 2.5 is released.
Note: This document assumes that you are very familiar with the operation of GNU CVS and it's internal algorithms and data structures for maintaining version control. For information on CVS, please refer to http://www.cyclic.com.
MacCVS Pro was not designed simply to be CVS on the Macintosh, it was designed to be extremely easy to use and much more Mac-savvy. Additionally, we wanted to leverage our existing development tools Metrowerks CodeWarrior, Projector, MPW) with our new CVS client.
Trying to develop for all these factors was not easy and we have had to resort to changing the way our client works compared to the GNU CVS client.
These issues should not affect the normal user of MacCVS Pro, but for people wanting to migrate from other Macintosh CVS tools, this can present a problem.
Issues in Storing CVS Entries Information
The entries information contains the file's name in the repository, current version on the user's disk, the date it was checked out, and tag and conflict information. The GNU CVS client stores it's entries information in an "Entries" file, "Entries.Static" file, and "Entries.Log" file inside the "CVS" directory of each source directory.
An example of a CVS "Entries" file:
/friends.html/220.127.116.11/Tue Mar 24 22:03:46 1998// /index.html/18.104.22.168/Tue Mar 24 22:03:46 1998// /links.html/22.214.171.124/Tue Mar 24 22:03:46 1998// /morepix.html/126.96.36.199/Tue Mar 24 22:03:46 1998// /pgpkey.txt/188.8.131.52/Tue Mar 24 22:03:46 1998// /pictures.html/184.108.40.206/Tue Mar 24 22:03:46 1998// /projects.html/220.127.116.11/Tue Mar 24 22:03:46 1998// /resume.html/18.104.22.168/Tue Mar 24 22:03:46 1998//
MacCVS Pro utilizes the Macintosh resource fork of each respective file to store this information. We did this so we could utilize the MPW Projector 'ckid' resource- a cornerstone of Macintosh source code control. Also, we felt that this would be a much faster way to store this information and it makes it easier for the front-end graphical interface to detect if a file has been moved or renamed.
MacCVS Pro stores entries information in two places in the resource fork: the MPW Projector 'ckid' resource and our own 'mcvs' resource. We mainly use the 'ckid' resource to signal that the file is under source control so that features, like modified read only status, in most source code editors work correctly. Since documentation on the MPW Projector 'ckid' resource was sparse, we avoided trying to utilize some of the advanced features of this resource.
The actual CVS entries information is stored in the 'mcvs' resource (ID 128) along with a couple extra items.
Differences Inside the CVS Directory
As alluded to above, the GNU CVS client stores all it's entries information and other stuff in "CVS" directories in each source directory. MacCVS Pro does a similar thing, creating invisible "CVS" folders in each source directory. However there are some differences as to what files we store in there and what data we store in those files. Here is the run down:
File Name: Repository
Purpose: Stores the remote path of where the particular source
directory is stored in the
Purpose: Stores the CVSROOT path of the repository that user checked out the particular source directory from.
Differences in MacCVS Pro: MacCVS Pro creates this file in all "CVS" directories but does not use it currently.
File Name: Tag
Purpose: Stores the tag of the particular source directory.
Differences in MacCVS Pro: None. We use this exactly the same way.
Below is the format for a 'ckid' resource. This is also documented in the MPW documentation.
UInt32 fChecksum; UInt32 fLocation; UInt16 fCurrentVersion; UInt16 fCheckedOutBySomeone; UInt8 fBranch; UInt8 fModifyReadOnly; UInt32 fUnused; UInt32 fCheckoutTime; UInt32 fFilesModificationDate; UInt32 fProjectID1; UInt32 fProjectID2; UInt16 fUserID; UInt16 fFileID; UInt16 fRevisionID;
Following this header are 5 Pascal style strings. Each string is separated by a NULL (0x00) byte. The strings are NOT stored with 255 bytes by default- only the byte amount of the text (plus the length byte) is stored in the resource.
PString fRemotePathPStr; (EOS) PString fUserNamePStr; (EOS) PString fRevisionPStr; (EOS) PString fFileNamePStr; (EOS) PString fTaskPStr; (EOS)
After the Pascal strings is a 16 bit wide integer that describes the length of the checkin comment data. The check in comment text follows immediately after words.
UInt16 fCommentLen; char fCommentData;'mcvs' Resource Format
Below is the format for a 'mcvs' resource. This is a special resource used by MacCVS Pro to store CVS entry information.
UInt32 fVersion; UInt32 fFlags; UInt32 fRefCon;
Following this header are 9 Pascal style strings. Each string is separated by a NULL (0x00) byte. The strings are NOT stored with 255 bytes by default- only the byte amount of the text (plus the length byte) is stored in the resource.
PString fFileNamePStr; (EOS) PString fRevisionPStr; (EOS) PString fConflictsPStr; (EOS) PString fOptionsPStr; (EOS) PString fTagPStr; (EOS) PString fUnused1PStr; (EOS) PString fUnused2PStr; (EOS) PString fUnused3PStr; (EOS) PString fUnused4PStr; (EOS)
After the Pascal strings is a 16 bit wide integer that describes the length of the remote path string. The remote path text follows immediately after words.
UInt16 fRemotePathLen; char fRemotePath;
'mcvs' field information: