UNIX and Windows observe different conventions for terminating lines in text files. UNIX systems normally terminate lines with a single <LF> (line feed, or new line) character and Windows systems terminate lines with a two-character <CR><LF> (carriage return, line feed) sequence. Some Windows applications can read and display files in either format, some Windows applications always write files using <CR><LF> format, and some Windows applications can be configured to determine which format to use.
Because of these different conventions, line-termination problems are a typical result of the use of text editors on files that must be edited on both UNIX and Windows platforms. For example, a file with the contents:
abc
def
ghi
would look like this if it were created by a typical Windows editor and read by a typical UNIX editor (for example, vi):
abc^M
def^M
ghi^M
The UNIX text editor renders the <CR> character as ^M. The same file would look like this if it were created by a typical UNIX editor and read by a typical Windows editor (for example, Notepad):
abcdefghi
To better support parallel development in mixed operating system environments, Rational ClearCase LT provides a text mode setting for views that controls how line terminators are handled when text files are presented to applications.
Each view has a text mode setting that specifies how it handles line terminator sequences. This setting only applies to file elements whose element type is text_file or a subtype of type text_file. You determine a view's text mode when you create the view. You cannot change the text mode of a view after the view has been created.
A ClearCase LT site configuration parameter determines the default text mode for view creation. For details, see the reference page for the setsite command.
You can create a view in any of three text modes:
transparent text mode. In a view created in transparent text mode, ClearCase LT does no line terminator processing. If no site default is specified, views are created in transparent text mode by default. To create a view in transparent text mode regardless of the site default, clear the Use interop (insert_cr) text mode check box on in the Advanced options of the View Creation Wizard, or use the -tmode transparent option to the mkview command.
If all the developers at your site use the same development platform (Windows or UNIX) or use tools that are compatible with either line-termination convention, all views should be created in transparent text mode.
insert_cr text mode. In a view created in insert_cr text mode, ClearCase LT inserts a <CR> character before every <LF> character. To create a view in insert_cr text mode, select the Use interop (insert_cr) text mode check box in the Advanced options of the View Creation Wizard or use the -tmode insert_cr option to the mkview command.
strip_cr text mode. In a view created in strip_cr text mode, ClearCase LT strips the <CR> character from every <CR><LF> sequence. To create a view in strip_cr text mode, use the -tmode strip_cr options to the mkview command. You cannot create a view in strip_cr mode from the View Creation Wizard.
In a view created in either insert_cr or strip_cr text mode, ClearCase LT adds or removes the <CR> characters whenever it updates the view. It reverses the <CR> manipulation (adding or removing <CR> characters as appropriate) during the checkin process.
NOTE: You cannot create a view in strip_cr mode from any GUI.
If you do not know a view's text mode, you can find out in one of two ways:
In Windows Explorer, right-click a drive that represents a view. Then click ClearCase > Properties of View. The view's text mode is displayed on the Access tab.
Use the cleartool lsview command with the -properties -full options.
With these methods, transparent text mode is displayed as unix
, strip_cr text mode is displayed as strip_cr
, and insert_cr text mode is displayed as msdos
.
ClearCase LT does not enforce any policy governing access to VOBs based on a view's text mode, and a user editing a file in a view that has the "wrong" text mode configuration can cause problems for other users who need to edit that file. Most sites with both Windows and UNIX development platforms should adopt a policy that allows users of the primary development platform to create views in transparent text mode and that limits the use of strip_cr or insert_cr text modes for the minority of platforms that require different line-termination conventions.
If most of your users are developing software on UNIX:
UNIX clients should use views created in transparent text mode.
Windows clients should use views created in insert_cr text mode.
If most of your users are developing software on Windows:
Windows clients should use views created in transparent text mode.
UNIX clients should use views created in strip_cr text mode.
No matter what policy you adopt, it is important to maintain a consistent combination of client platform, view text mode, and VOB. If a client uses a view in an interop text mode (strip_cr or insert_cr) to access a VOB, then later begins using a view in transparent text mode to access the same VOB, versions created by the views in different text modes will be difficult to compare or merge.
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |