It's all about the answers!

Ask a question

LINE_DELIMITER and ClearCase Synchronized Streams


Erik anderson (38315029) | asked Nov 17 '08, 1:42 p.m.
I wanted to synchronize an existing Jazz stream with a new UCM stream so I setup the ClearCase connector to sync them. The UCM stream is a child of the project Integration stream - the build teams owns the project integration stream so I can't sync directly into it (I can't lock it). I plan to rebase/deliver the child UCM stream to integrate changes to the UCM project integration stream.

The Jazz sync and initial ClearCase delivery worked ok. However, my second and subsequent ClearCase delivery ran into merge conflicts even though all changes originated from the Jazz stream (the merges should have been trivial).

I suspect the problem is due to line delimiter differences fouling the ClearCase merge. The view made by the connector is using UNIX text mode (the default) but my integration view uses DOS text mode.

I want to ensure we don't cause unforeseen merge problems in either environment. For example, introducing CRLF's into the UCM component causes problems for other people using the UCM project on windows (they will get CRCRLF in windows views and have merge problems).

Can you recommend a configuration (LINE_DELIMTER settings, File Type properties, etc) or any other best practices to accomplish this?

Details

For a jsp file with file type property of "binary". The author edited using RTC on windows.

All line endings counts used a ClearCase view with UNIX text mode.

1) Ran sync - version 1 in child stream:

Total Count of CR-CR-LF character combinations = 0
Total Count of CR-LF character combinations = 56
Total Count of CR characters by itself = 0
Total Count of LF characters by itself = 0

2) Delivered child stream - version 1 in project integration:

Total Count of CR-CR-LF character combinations = 0
Total Count of CR-LF character combinations = 0
Total Count of CR characters by itself = 0
Total Count of LF characters by itself = 56

3) Ran sync - version 2 in child stream:

Total Count of CR-CR-LF character combinations = 0
Total Count of CR-LF character combinations = 24
Total Count of CR characters by itself = 0
Total Count of LF characters by itself = 0

Tried to deliver child stream and had conflicts which where very hard to decipher.

5 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Nov 18 '08, 1:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
What is the value of the ClearCase LINE_DELIMITER property and Jazz
LINE_DELIMITER property of your sync stream? It appears that they are
CRLF, in which case you must have modified them (since the default is
LF). Is that true? If so, that would be your problem, since your use
of an insert_cr (msdos) text mode view indicates that text files in your
VOB are expected to be stored with LF line endings. To fix this, change
the value of both LINE_DELIMITER properties to be LF.

If any of the above assumptions are not true, let me know, and we need
to investigate further.

Cheers,
Geoff

eanderso wrote:
I wanted to synchronize an existing Jazz stream with a new UCM stream
so I setup the ClearCase connector to sync them. The UCM stream is a
child of the project Integration stream - the build teams owns the
project integration stream so I can't sync directly into it (I can't
lock it). I plan to rebase/deliver the child UCM stream to
integrate changes to the UCM project integration stream.

The Jazz sync and initial ClearCase delivery worked ok. However, my
second and subsequent ClearCase delivery ran into merge conflicts
even though all changes originated from the Jazz stream (the merges
should have been trivial).

I suspect the problem is due to line delimiter differences fouling the
ClearCase merge. The view made by the connector is using UNIX text
mode (the default) but my integration view uses DOS text mode.

I want to ensure we don't cause unforeseen merge problems in either
environment. For example, introducing CRLF's into the UCM component
causes problems for other people using the UCM project on windows
(they will get CRCRLF in windows views and have merge problems).

Can you recommend a configuration (LINE_DELIMTER settings, File Type
properties, etc) or any other best practices to accomplish this?

Details

For a jsp file with file type property of "platform". The
author edited using RTC on windows.

All line endings counts used a ClearCase view with UNIX text mode.

1) Ran sync - version 1 in child stream:

Total Count of CR-CR-LF character combinations = 0
Total Count of CR-LF character combinations = 56
Total Count of CR characters by itself = 0
Total Count of LF characters by itself = 0

2) Delivered child stream - version 1 in project integration:

Total Count of CR-CR-LF character combinations = 0
Total Count of CR-LF character combinations = 0
Total Count of CR characters by itself = 0
Total Count of LF characters by itself = 56

3) Ran sync - version 2 in child stream:

Total Count of CR-CR-LF character combinations = 0
Total Count of CR-LF character combinations = 24
Total Count of CR characters by itself = 0
Total Count of LF characters by itself = 0

Tried to deliver child stream and had conflicts which where very hard
to decipher.

permanent link
Erik anderson (38315029) | answered Nov 18 '08, 9:00 a.m.
No, I used the defaults for both providers (LF) and the view created by the connector is using unix text mode (the DO_NOT_USE_* view). But I think I see what's going on.

.jsp files are defaulting to file type of "binary" but the content of the file in my local workspace have CRLF's.

3 \\wsa6\clearcase\tools\crlf-check.exe ViewMenu.jsp

Total Count of CR-CR-LF character combinations = 0
Total Count of CR-LF character combinations = 24
Total Count of CR characters by itself = 0
Total Count of LF characters by itself = 0

The editor is saving the file with CRLF's. The connector sync's them into the UCM child stream with with CRLF's (since the sync view is using unix text mode). When I deliver (UCM) to project integration using an integration view with dos text mode, it strips the CR's.

Subsequent deliveries cause fits with the ClearCase merge tool (inconsistent line ending in contributors). We've seen this before with ClearCase when some developers use the wrong text mode.

I can try to use LINE_DELIMTER of CRLF.

permanent link
Erik anderson (38315029) | answered Nov 18 '08, 4:32 p.m.
It appears the connector always creates a ClearCase view with unix text mode and the LINE_DELIMITER is only enforced on text files.

The problem is .jsp files are treated as binary (by default) and the editor saves them with CRLF's. The connector does not enforced LINE_DELIMITER since the file types are binary and they are checked into ClearCase with CRLF's.

I can think of a lot of situations where this will bite us. Once the CRLF's get into the vob, they are hard to clean up.

Is there a way to change file type associations for all users or does each user have to customize their file type preferences?

Is there a way to change the editor to not save CRLF's?

I'm running out of ideas.

permanent link
Geoffrey Clemm (30.1k33035) | answered Nov 19 '08, 12:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note that the connector uses "transparent text mode" views because the
connector uses Jazz machinery (not the ClearCase view machinery) to
perform the line ending conversions. And as you pointed out, a file can
only have line-ending conversions performed on it if it is known to be a
text file (such conversions would of course trash a non-text file).

So you need to get your text files in the Jazz repository properly
classified as text files in order for the connector line-ending
machinery to be applied to them.

If you are using the Eclipse editor, you can specify what files should
be treated as text files in the preferences:

- General -> Content Types
- Team -> File Content
- Team -> Jazz Source Control -> File Properties

Hopefully an Eclipse Guru can comment on which of these (if any) are
stored in preference files (and therefore apply to all users) and which
have to be specified explicitly in the preferences of a workspace.

So although I agree that you don't want CRLF files stored in your VOB
that assumes LF endings, because in an insert_cr (ms_dos) text mode
view, the file would appear with CRCRLF endings, I don't understand why
you are getting merge conflicts. If you edited the file in the
insert_cr text mode view, the file would have CRCRLF endings, but then
when you checked it in, it would have stripped out the extra CR, and it
would have been saved as CRLF, and so no merge conflict should have
occurred ... or am I missing something? (with line-endings scenarios,
that is not unlikely :-)

Cheers,
Geoff


eanderso wrote:
It appears the connector always creates a ClearCase view with unix
text mode and the LINE_DELIMITER is only enforced on text files.

The problem is .jsp files are treated as binary (by default) and the
editor saves them with CRLF's. The connector does not enforced
LINE_DELIMITER since the file types are binary and they are checked
into ClearCase with CRLF's.

I can think of a lot of situations where this will bite us. Once the
CRLF's get into the vob, they are hard to clean up.

Is there a way to change file type associations for all users or does
each user have to customize their file type preferences?

Is there a way to change the editor to not save CRLF's?

I'm running out of ideas.

permanent link
Andrew Hoo (1.0k1) | answered Nov 19 '08, 9:42 a.m.
JAZZ DEVELOPER
The file properties preferences are saved locally for only your workspace. So you'll have to convert all your existing jsps to "Platform" or other text, and then tell everybody on your team who creates new JSPs to set their preferences so that the new default behaviour will be to treat them as text.

The easiest way to do it would be to add it to General->Content Types and add *.jsp to the "Text" content type.

The Team->Jazz Source Control->File Properties uses the same Eclipse Content Types preferences but adds mappings in case you want different Mime types in different parts of the hierarchy.

I believe ther Team->File Content is used for CVS mappings.

I haven't used the ClearCase connector, so I can't comment on what what the merge workflow should be like.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.