Search code examples
clearcaseclearcase-ucm

ClearCase automatic merge puts the content of the file in single line


We are using ClearCase UCM INTEROP setup in our organization.
We are facing a strange issue where the file content in put on one line while doing a merge and hence causing the build to fail.

Does anyone know why this is happening?


Solution

  • There is another thing that can sneak up and bite you here.

    View text modes -- there are 3 for ClearCase, and you can get unexpected results if you use the wrong 2.

    Those modes are:

    • insert_cr (also known as msdos). This inserts carriage returns on cleartext creation (file open/edit/etc.) and strips them at checkin.
    • transparent. Doesn't make any changes to the line terminations.
    • strip_cr. This converts Windows line terminations to Unix ones on cleartext creation. It then re-inserts them on checkin.

    If you use strip_cr for unix views, and insert_cr for Windows ones, you will have all kinds of line termination issues. And in some cases this can break builds.

    You need to use the 2 that are adjacent to one another on the list above. With Windows using either insert_cr and unix "transparent". Or Windows "transparent" and unix strip_cr.

    You may want to look at the problem file in another editor (notepad++ is one that handles both line termination styles well) and see whether you have Unix or Windows line terminations.

    It would also help to know the platform where the merge was attempted. If it was done on Windows, then @VoC's steps will work as they call the Windows GUI text merge tool. You may want to try the same thing using the Windows/Unix CLI merge tool (cleardiff) if the files are "text_file" elements. We have seen cases where the 2 CLI and GUI merge tools behave differently.