IBM Support

How to specify file properties when checking in new files with scm command line

Question & Answer


Question

How do you specify the file properties and line delimiter types when share a project or check in new file using "scm" command line in IBM Rational Team Concert (RTC)?

Cause

When your team develops software on more than one platform, differences in platform conventions for line termination in text files can affect content merges and other development tasks. By default, RTC source control stores text files in a normalized format, and follows the workspace platform line delimiter convention when loading a file into a sandbox.

RTC Eclipse client includes a File Content preference page that maps file name extensions to line delimiter types. To change the default mapping, you can click the main Eclipse menu "Window > Preferences" and navigate to "Team > Jazz source control > File Properties" page.

If you are using "scm" command line to share a project or check in a file, the preference configuration in the Eclipse client will not take effect for the files checked in or shared by the command line.

Answer

You can use a "magic" file to change the default mapping between the file name extensions and the line delimiter types if using "scm" command line to share a project or check in a file.

The magic file can be created following the steps below.

  1. Create a new "magic.properties" file.

    This file resides in the following directory, by default:

    UNIX and Linux: HOME/.jazz-scm/

    Windows: LOCALAPPDATA\jazz-scm\
    (For Windows 7, LOCALAPPDATA defaults to C:\Users\userid\AppData\Local.)

  2. Edit the magic.properties file in the format below:

    *.txt: delim: lf
    *: delim: platform


    where the "delim" keyword may have any one of the following values:
    • lf indicating that line feeds (ASCII 0x0a) are newlines within the file
    • cr indicating that carriage returns (ASCII 0x0d) are newlines within the file
    • crlf indicating that carriage-return/line-feed pairs are considered newlines within the file
    • platform indicating that RTC should use the platform-specific character to denote newlines
    • none indicating that no newline conversion should occur.

When you run "scm checkin" or "scm share", the new files, added in RTC source control, will use the delimiter type identified by the magic file.

Note: If you save the "magic.properties" file to an alternate directory instead of your home directory, you can specify that it be read from this alternate directory by setting the environment variable SCM_CONFIG_DIRECTORY. Set it to the full path of the jazz-scm directory, for example, C:\temp\jazz-scm.

[{"Product":{"code":"SSUC3U","label":"IBM Engineering Workflow Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"SCM","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"3.0.1;3.0.1.1;3.0.1.2;3.0.1.3;3.0.1.4;3.0.1.5;3.0.1.6;4.0;4.0.0.1;4.0.0.2;4.0.1;4.0.2;4.0.3;4.0.4;4.0.5;4.0.6;4.0.7;5.0;5.0.1;5.0.2;6.0","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Team Concert

Document Information

Modified date:
16 June 2018

UID

swg21607057