Cooperative Media Lab [hide]
Internal Workspace [hide]
Online users [hide]
5 online users
Menu [hide]

CVS and binary files

print
A CVS repository is set up on cml.medien.uni-weimar.de. The following describes how to deal with binary files.

The Story
CVS does not recognize binary files by default. Yet, CVS modifies files added to the repository. The following modifications are done:
  • keyword expansion, e.g. expanding $Id:$ to $Id: readme.txt,v 1.4 2004/05/27 10:51:47 oemigldap Exp $
  • line end conversions, CR LF on Windows to only LF on Unix.
especially the last step breaks binary files when one checks out a project e.g. from a unix cvs repository to a windows machine.

What to do?
Keyword expansion and line end conversion need to be switched off for binary files. This is done by using the -kb option when adding files to the repository:
$>cvs add -kb filename

When your file is already located in the repository you can use:
$>cvs admin -kb filename

How to find out, if it has been set for a particular file? Use the cvs status command:
felix35:~/test/binarytest oemig$ cvs status -v binaryfile.gif 

===================================================================
File: counterfeitsquare.gif     Status: Up-to-date

   Working revision:    1.1.1.1
   Repository revision: 1.1.1.1 /usr/local/cvsroot/binarytest/binaryfile.gif,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      -kb

   Existing Tags:
        start                           (revision: 1.1.1.1)
        oemig                           (branch: 1.1.1)

You can also inspect the Entries file within your CVS directories. There you should find the STICKY OPTION -kb as well:
felix35:~/test/binarytest/CVS oemig$ cat Entries 
/binaryfile.gif/1.1.1.1/Mon Jul 26 08:15:21 2004/-kb/
/notmarkedasbinary.gif/1.1/Mon Jul 26 08:30:45 2004//
/readme.txt/1.1.1.1/Mon Jul 26 08:15:21 2004//
D
felix35:~/test/binarytest/CVS oemig$ 

img/wiki_up//jbuilder.gif ... with JBuilderX
"If JBuilder does not yet recognize a non-text-based file type in CVS, you must specifically include the file's extension in JBuilder's list of Generic Binary file types. To include it,

1. Choose Tools|IDE Options.

2. Select the File Types tab.

3. Select the Generic Binary file type.

4. Click Add.

5. Enter the new extension.

If necessary, you can use the file stored in the .precvs directory to restore the original binary file."
Further information: http://info.borland.com/techpubs/jbuilder/jbuilderx/teamdev/cvs4pg.html#binaryexternal link

img/wiki_up//eclipse.gif ... with Eclipse 3.x
does that automatically :)

Created by: oemig last modification: Monday 26 of July, 2004 [11:59:27 UTC] by oemig