Tuesday, November 21, 2006

I Hate ClearCase Part II - When a text file isn't a text file!

Here's a question:  If you have a text file that contains a very long line of text (>8000 characters), is it still a text file?

I'd say Yes. But ComputerClearCase says No. Or at least hinted it meant No via several obscure error messages.

The file in question is a whole bunch of JavaScript code (part of the Microsoft AJAX release) that is not intended to be read by anyone viewing a web page, and hence is sensibly put on one line (albeit 69168 bytes in length). 

Firstly, I was getting a strange error when adding them to ClearCase.  Apparently, despite of the error, they were being added – I found them in a checked-out state.  Upon trying to check them in, I got:

Error checking in '...MicrosoftAjax.js'.  Type manager "text_file_delta" failed create_version operation.
Unable to check in '...MicrosoftAjax.js'

...followed by OK and Cancel buttons (quite how one can Cancel an operation that can't be done anyway is beyond me!)

I then thought I’d take a look at the file and did a ‘diff’ with the previous version.  I got this:

Error encountered doing compare operation.
"c:\temp\ccdm02327" is not a 'text file':  it contains a line exceeding 8000 bytes.
Use a different type manager (such as a compressed file).

So, according to ClearCase, a text file is not a text file if it has lines of over 8000 characters!

Anyway, the solution was to use the cleartool command line tool to add the file using a different 'type' - a compressed text file type.  Note that this doesn't actually change the contents of the file, nor the way it's handled (thankfully!).  Of course, once the solution was presented to me...

C:\folder\ScriptLibrary\Release>cleartool mkelem -nc -eltype compressed_text_file MicrosoftAjax.js

...everything became perfectly clear!


Zulfiqar said...


zahmed said...


funnyClearCaseVideo said...

If you hate ClearCase, you'll get a chuckle out of this video!

Barry said...

That's interesting, given that compressed_text_file uses the same type manager that does not allow more than 8000 characters in a line.

The solution would be to use a type manager that does support more than 8000 characters.

manuel aldana said...

i had the same problem.

trying to add compressed swfobject.js (js-library for flash stuff) which was >8K on one line was not possible.

i solved it by introducing a line break in a standard lib file, which is just ridiculous!!

If you're interesting my summary of ClearCase is crap:

Anonymous said...

commandprompt>cleartool chtype -nc compressed_file too_long.jsChange version manager and reconstruct all versions for "editor-min.js"? [no] yesChanged type of element "editor-min.js" to "compressed_file".

Then check in the file from Windows Explorer or from ClearCase explorer.

tg said...

Hello Steve,

Don't know if you still use ClearCase, but I know these problems...
We have smart and simple plug-ins for ClearCase that might help you. Check our website: http://gomidjets.com

Anonymous said...