clearexport_rcs

Converts RCS files to elements

APPLICABILITY


Product

Command Type

ClearCase


command


ClearCase LT


command


Platform

UNIX


Windows

SYNOPSIS

clearexport_rcs [ -r ] [ [ -s date-time ] [ -p date-time ] | -I { now | date-time } ]

[ -V ] [ -S ] [ -t temp-dir-pname ] [ -T translation-file ]
[ -o datafile-pname ] [ source-name ... ]

DESCRIPTION

The clearexport_rcs command processes Revision Control System (RCS) files so they can be imported into ClearCase or ClearCase LT elements and versions. The source data can range from a single file to an entire directory tree.

During the export stage, you invoke clearexport_rcs in the area where the RCS files reside. clearexport_rcs creates a datafile (by default, named cvt_data), and places in it descriptions of elements, branches, and versions. clearexport_rcs follows symbolic links it encounters during the export stage.

In the import stage, you invoke clearimport on the datafile to import information into the new VOB.

clearexport_rcs ignores most information in RCS files that is not related to version-tree structure. clearexport_rcs converts each RCS symbol, which names a revision or branch, into the appropriate construct: version label or branch. You can specify a translation file to control naming, enforcing consistency over multiple invocations of clearexport_rcs. You can use the -S and -V options to preserve RCS state attributes and RCS revision numbers as attributes of the corresponding ClearCase or ClearCase LT versions.

clearexport_rcs and clearimport use magic files to determine which element type to use for each element clearimport creates. For more information on magic files and file typing, see the cc.magic reference page.

NOTE: You cannot run clearexport_rcs on UNIX and then run clearimport on Windows to import the data, or vice-versa. However, you can transfer data in either direction between UNIX and Windows by mounting the UNIX VOB or file-system on the Windows machine and running both clearexport_rcs and clearimport on the Windows machine.

RCS Files, Working Files, and Locks

clearexport_rcs works directly with the structured RCS files. It does not process the working files created with co and co -l commands. Be sure to check in working files with the ci command before running the exporter. clearexport_rcs issues warning messages when it encounters checked-out files, but it still processes them.

clearexport_rcs ignores all RCS locks.

If RCS files are stored in RCS (or rcs; case is not important) subdirectories, clearexport_rcs collapses the subdirectory level in the export process. For example, RCS file ./proj/RCS/main.c,v becomes element ./proj/main.c.

SPECIAL CHARACTERS IN FILE NAMES

During import, clearimport invokes a shell to extract data from the datafile. clearimport can handle some, but not all, characters that are special to shells. Import fails for any file name that includes any of these characters:

`  '  "  <Tab>  [  ]  ?  *  %

For example:

Succeeds Fails

foo&bar

foo[bar

$MY_LIB

yellow`sunset

file name

file*name

Before running clearexport_rcs, rename any file whose name contains these characters.

NOTE: If you specify datafile-pname or source-name and any of the names include spaces, you must escape the space characters (UNIX):

% clearexport_rcs src\ files

or enclose the name in double quotes (Windows):

> clearexport_rcs "src files"

HANDLING OF RCS SYMBOLS

An RCS symbol is a mnemonic name for a particular revision or branch of an RCS file. clearexport_rcs translates the symbols to version labels and branch names (more precisely, to names of label types and branch types).

Because there is no concept of a subbranch of the main branch, clearexport_rcs does not process single-digit symbols that name RCS branches. If an RCS symbol includes characters that are not valid in names of label types or branch types, clearexport_rcs replaces the offending name. For example, the RCS symbol C++ can be renamed to "C..".

A label type cannot have the same name as a branch type within the same VOB. If the same RCS symbol names both a revision and a branch-not necessarily in the same RCS file-clearexport_rcs renames one of them. For example, after exporting a symbol FX354, which names a branch, it may encounter the same symbol as the name of a revision in another RCS file. In this case, it creates label type FX354_1.

Translation File

This renaming of RCS symbols can introduce inconsistencies over multiple runs of clearexport_rcs. The same symbol may be renamed during processing of some RCS files, but not chang during processing of other files. You can enforce consistency by using the same translation file in multiple invocations of clearexport_rcs. If you name such a file, using the -T option, clearexport_rcs uses it as follows:

The first time you use clearexport_rcs, use -T to create a new translation file. On subsequent invocations of clearexport_rcs, use -T again, specifying the same translation file for consistent name translation.

The translation file consists of one or more lines in the following form:

{ label | branch } old-name new-name

For example, to rename the branch type pre_import_work to post_import_work and the label BL1.7 to IMPORT_BASE, the translation file contains the lines:

branch pre_import_work post_import_work
label BL1.7 IMPORT_BASE

No blank lines are allowed in the file.

HANDLING OF OBJECTS THAT CANNOT BE EXPORTED

When clearexport_rcs encounters a file or directory that cannot be exported (for example, a file with format problems, or a broken symbolic link), it prints an error and continues. After creating the data file, the command prints a summary of the files and directories that could not be exported.

RESTRICTIONS

None.

OPTIONS AND ARGUMENTS

HANDLING OF DIRECTORY ARGUMENTS.  Default: If you specify a directory as a source-name argument: (1) clearexport_rcs Processes the files in that directory but ignores the contents of the subdirectories; (2) clearimport creates a directory element for source-name and for each of its subdirectories.

-r

clearexport_rcs descends recursively into all source-name arguments that are directories.

SELECTIVE CONVERSION OF FILES.  Default: clearexport_rcs processes all RCS revisions it finds.

-s date-time

clearexport_rcs processes only RCS revisions that have been modified since the time specified. Use this option for regular, incremental updating of an element from an RCS file that is still under development. Be sure to specify a date-time that covers the entire period since the preceding update. In other situations, it is probably better to use -I instead of -s.
clearexport_rcs determines whether to process an RCS archive by using the last-modified date/time of the archive. If this date/time is before the date-time you specify with -s, clearexport_rcs does not process any of the revisions in the archive. If the archive's date/time is after the date-time you specify, clearexport_rcs processes the following revisions in the archive:

  • All revisions created since the specified date-time
  • All revisions that have labels
  • All revisions from which branches sprout
NOTE: In an incremental updating situation, if you remove a label or branch from an RCS revision, clearimport does not remove the label or branch from the element.
-p date-time

Like -s, but processes only versions modified with new metadata (labels, branches, attributes, and so on) or created prior to the specified time.
-I { now | date-time }

Processes important revisions only, but includes all revisions created since the specified time. A revision is important if any of these conditions is true:

  • It is the most recent version on its branch.
  • It has a label.
  • A subbranch is sprouted from it.
Specify the time in one of the following formats:
date.time | date | time | now
where:

date

:=

day-of-week | long-date

time

:=

h[h]:m[m][:s[s]] [UTC [ [ + | - ]h[h][:m[m] ] ] ]

day-of-week

:=

today |yesterday |Sunday | ... |Saturday |Sun | ... |Sat

long-date

:=

d[d]-month[-[yy]yy]

month

:=

January |... |December |Jan |... |Dec

Specify time in 24-hour format, relative to the local time zone. If you omit the time, the default value is 00:00:00. If you omit date, the default is today. If you omit the century, year, or a specific date, the most recent one is used. Specify UTC if you want to resolve the time to the same moment in time regardless of time zone. Use the plus (+) or minus (-) operator to specify a positive or negative offset to the UTC time. If you specify UTC without hour or minute offsets, Greenwich Mean Time (GMT) is used. (Dates before January 1, 1970 Universal Coordinated Time (UTC) are invalid.)

PRESERVATION OF RCS INFORMATION AS ATTRIBUTES.  Default: clearexport_rcs does not attach attributes to versions exported from RCS revisions.

-V

Attaches an attribute of type RCS_REVISION to each newly created version. The string value of the attribute is the RCS revision number of the exported revision. (clearimport creates attribute type RCS_REVISION, if necessary.)
If you use the -s option with this option, clearimport attaches RCS_REVISION attributes only to revisions created after the date-time you specified.
Each attribute requires about 1 KB of storage in the VOB database.
-S

If an RCS revision's state is not the default (Exp), attaches an attribute of type RCS_STATE to the newly created version. The string value of the attribute is the RCS state attribute of the exported revision.

DIRECTORY FOR TEMPORARY FILES. Default on UNIX systems: the value of P_tmpdir (set in the stdio.h system include file; you can override this value by setting the TMPDIR environment variable). Default on Windows systems: the value of the TMP environment variable.

-t temp-dir-pname

Specifies an alternate directory for temporary files. This directory must already exist.

HANDLING OF BRANCHES AND LABELS.  Default: As described in the section HANDLING OF RCS SYMBOLS, clearexport_rcs may rename a branch or label type to avoid naming conflicts.

-T translation-file

Uses the specified translation file to control and record the conversion of RCS symbols to version labels and branch names.

STORAGE LOCATION OF DATAFILE.  Default: clearexport_rcs creates datafile cvt_data in the current working directory.

-o datafile-pname

Stores the datafile at the specified location. An error occurs if datafile already exists.

SPECIFYING FILES TO BE EXPORTED.  Default: clearexport_rcs processes the current working directory (equivalent to specifying "." as the source-name argument). If you specify a directory as a source-name argument: (1) clearexport_rcs processes the files in that directory but ignores the contents of the subdirectories; (2) clearimport creates a directory element for source-name and for each of its subdirectories (except one named RCS or rcs).

source-name ...

One or more pathnames, specifying RCS files and/or directories:

  • For each specified RCS file, clearexport_rcs places a description in the datafile.
  • For each specified directory, clearexport_rcs places descriptions in the datafile for each of the RCS files it contains. clearimport creates a directory element for the specified directory itself, and for its subdirectories (except one named RCS).
Each source-name must be a simple file or directory name. This enables clearimport to reliably access the source data. Specifying a parent directory (..) causes an error, as does any UNIX pathname that includes a slash or any Windows path that includes a backslash.
Thus, before entering this command, you should change to the directory in or under which the RCS files to be exported reside. If the RCS files reside in RCS subdirectories, use the -r option to enable clearexport_rcs to find them.

EXAMPLES

SEE ALSO

clearexport_*, clearimport, events_ccase, relocate, rcs(1), rsh(1) or remsh(1), sccs(1)