|
CVS Add and Storage Formats
|
|
|
|
Putting a file under CVS revision control with MacCVSClient, you have
the choice to use one of three different storage formats.
Why do we have storage formats and why doesn't CVS on UNIX? The reason is the way resources
are stored in resource
forks in MacOS files. Using the different storage formats, you can store resource forks
of your MacOS files in different ways depending on how you want to work with them.
Whenever you use "CVS/Add" to put a new file in your module under CVS revision
control, you have to specify what storage format you want to be used for it.
|
|
|
|
|
When adding a file to a CVS module, you can choose the file's storage format:
- Data fork only
- This is good for text files. Also, graphics data like JPEG or GIF
files can be stored very efficiently using this storage format. The
resource fork of the file is ignored though. This storage format is marked
"DF" in the module window.
- Resource fork and data fork in AppleSingle format
- The AppleSingle format was introduced by Apple to store or process
MacOS files including resource fork, data fork, finder information, etc.
on UNIX or other foreign platforms. This storage format is marked
"DRF" in the module window.
- Mergeable resource fork in RBL (Resource By Line) format
- The RBL format is new and introduced with MacCVSClient 1.4. It is very
useful, if you want to put resource files of types like PPOB or RSRC
under revision control. The RBL format is CVS mergeable and diffable.
This storage format is marked "RBL" in the module window.
|
|
|
|
|
If you use CVS to store your software development sources or your web pages,
most of your files probably are TEXT files. For these, the "data fork only" storage format
is the best choice. You are also free to CVS enable keyword substitution for
text files. Depending on the editors you're using, CR/LF conversion can be disabled
as well.
When keeping a set of web pages under CVS revision control, you might want to store
your graphics like GIF or JPEG files in the CVS repository. These files and all other
files that don't use the resource fork can be stored as "data fork only" as well. If
redundant information (like custom icons that show the contents of a graphics
file in the finder) is held in the resource fork, the "data fork only" storage format
can be used as well. Keep in mind though that resources are not stored in the
repository.
When a "data fork only" file is updated with new data from the CVS server, it's existing
resource fork is kept unchanged. This is useful for e.g. TEXT files where cursor and
window positions are stored in the resources by different editors.
Be sure that you disable CVS keyword sustitution and CR/LF conversion when adding
a non-TEXT "data fork only" file to your CVS module. If you forget this, your binary
data is quite likely to get corrupted by unwanted string replacement and/or
CR/LF conversion.
IMPORTANT note for web page developers: if you don't have good reasons
for doing otherwise (in other words: you really know what you're doing), all web page
files (like HTML, GIF, JPEG, etc.) should be stored "data fork only" format.
AppleSingle and RBL files are most probably not understood by the average foreign OS web
browser and thus pretty useless on the average web site. There might be rare exceptions
but as a rule of thumb this holds. Forgive me any technical inadequacies here, I
hope you get the idea I wanted to convey.
|
|
|
|
|
If you have files that contain vital data in both resource and data fork,
you can add them to your CVS module in data and resource fork storage format. Here,
in AppleSingle format, both data and resource forks plus
finder information like e.g. file type and file creator are stored
in the CVS repository. This format is supported by MacCVS Pro and MacCVS as well.
Be sure disable CVS keyword substitution and CR/LF conversion here as well. See
also the last paragraph in Data Fork Only above.
|
|
|
|
|
If you have a file that uses the resource fork only, you can store it in RBL
format in CVS repositories. Files in RBL format are CVS diffable and CVS
mergeable.
Suppose in your MacOS software developement project, you have e.g. PPOB or RSRC
files storing the resources for your applications menus, windows, dialogs, etc.
Wouldn't it be useful to have the same diff and auto merge functions for these
resource files as CVS offers for source code files? This is where RBL comes in.
It does that very job.
When adding a file as mergeable resources in RBL storage format to your CVS module,
you can even enable CVS keyword substitution. If you put any CVS keyword string
like "Id", "Revision", etc. between dollar signs
into a resource's name and then commit the file, you have the keyword expansion
result available in the resource name.
The resource data is encoded as text in a robust way. Robust here means that keyword
expansion can not corrupt it. Note also that the RBL storage format does not only work for
PPOB or RSRC files. Almost any resource only file should be storable in RBL.
Three restrictions apply to the RBL format:
- When MacCVSClient stores a resource file as RBL in the repository, the
resource names must not
contain characters with codes lower than SPACE. All characters with codes lower
than SPACE are replaced by SPACE characters.
- Only resources can be stored in RBL. Data forks can't. Moreover,
existing data forks
will be deleted when the file is updated with new data from the CVS server.
- The CVS server must support 8 bit text and loooooong text lines. In RBL, each
resource is converted to a single long text line. Depending on the size of the
resource, this can easily amount to several kilobytes or even more. We use
CVS 1.10 on Linux and it works OK here.
|
|
|
|
|
When you want to add files to your module, you have to select them in your module
window first. The files you select to be added need to be unknown to CVS. Otherwise they
already are part of your module and obviously don't need to be added anymore.
There are some minor restrictions to the "CVS/Add" command in MacCVSClient:
- You can only add set of files OR a set of folders at the same time.
You cannot add both files and folders in one "CVS/Add" command.
- The set of files or folders you want to add need to be located in
a single (sub)folder of the module. You cannot add files "aaa:bbb:xxx"
and "aaa:ccc:yyy" at the same time.
- If you add a set of files, all of them need to have thge same file types
and file creators.
None of these result in major inconveniences during the work with MacCVSClient.
At times, you might just have to run several "CVS/Add" commands instead of a
single one.
|

When adding files, the following settings are recommended in the "CVS Add" dialog:
- TEXT files: Data Fork, you can select any CVS keyword substitution
setting.
- non TEXT files using data fork only: Data Fork, be careful about
keyword substitution! Safe and thus recommended is
Keep Old Keyword String + Inhibit CR/LF Conversion (it's the middle
radio button in the lower row).
- Files using both data fork and resource fork: Data + Resource Forks.
If you select this, the file(s) will be stored in AppleSingle format on the
CVS server.
I highly recommend that you disable keyword substitution and CR/LF conversion
when storing files in AppleSingle format.
- Use the Mergeable Resources setting for resource fork only files.
With this option, the file(s) are stored in RBL format on the CVS server.
Like in normal text files, any CVS keyword substitution setting can be used.
|
|
|
|
|
The "CVS/Import" command currently regards all files as text files. It
does not know about file storage formats yet. Until that is fixed, I recommend to
import new and non empty modules "by hand".
If you haven't got any files in your project, the procedure is obvious. Otherwise
this means:
- Create a new and empty folder and name it like you want your module to be called.
- Import this empty folder into your CVS repository.
- Check out a working copy of this new and empty module.
- Move all existing files and folders of your project into this freshly checked out
working copy (some call this working copy the "sandbox").
- Use "CVS/Add" to add files and folders one by one or in groups.
When adding the files, make sure to set file storage format and keyword expansion
appropriately as described above.
|
|
|
|
|
Rev. 1.3 - Copyright © 1998 Fontworks Ltd.
|
|