Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Delphi sometimes revert text form files (DFM) to binary format?

Our Delphi 7 development team stores form files (dfm) in text mode, and uses a source control system (Subversion) to track changes.

Sometimes, we noticed that a form file returned to binary format between revisions, causing diff tools like TortoiseMerge to complain.

Using the Subversion change log, I can see that the DFM file was stored in text form before. The software developers never change the storage file format back to binary manually.

Have you encountered the same? Is it a known problem?

like image 315
mjn Avatar asked May 09 '09 07:05

mjn


3 Answers

You may be interested in investigating the use of Beyond Compare instead of TortoiseSVN's built-in merge tool. Beyond Compare is written in Delphi, and natively knows how to read binary DFMs. This means that it then becomes less of an issue (or even no issue) whether your DFMs are stored in Subversion in binary or text. Beyond Compare V3 also does 3-way merging which makes it really easy to merge multiple commits etc. Even ignoring the ability to diff binary DFMs, it's still a much better diff viewer than TortoiseSVN's built-in tools. I can highly recommend it, and it's very inexpensive (I have no connection with Scooter Software, other than being a very happy customer).

Scooter Software

like image 70
3 revs, 3 users 93% Avatar answered Oct 11 '22 13:10

3 revs, 3 users 93%


This does happen in Delphi 7 but is fixed in later versions. Usually you access forms in the IDE by opening the .pas file and then switching to the Form View. Right click your form and it will show that it is "Text DFM" ticked if you have done this before.

You will experience the problem you have described of a text DFM switching to a binary DFM when in the Delphi 7 IDE you open the .dfm file directly. eg. File->Open->Somefile.dfm .. Right click the dfm and choose "View as Form". Now right click the form, you will see that the "Text DFM" is unticked.

We were getting the problem when we opened up a DFM which was a grep search result. It had us perplexed also, and would cause corruption of the dfm in cvs as it was checked in as text.

like image 35
Jared Davison Avatar answered Oct 11 '22 15:10

Jared Davison


This sometimes happens when the IDE gets confused.

It usually starts after you got an access violation inside the Delphi 7 IDE.

Sometimes also one or mor of your Delphi editor buffers inside the IDE become readonly (while the files on disk are still read/write).

The behaviour occurs much less than in Delphi 5 or 6, but sometimes it does occur in Delphi 7.

The best thing you can do is restart the Delphi 7 IDE as soon as you get an access violation.

like image 31
Jeroen Wiert Pluimers Avatar answered Oct 11 '22 13:10

Jeroen Wiert Pluimers