clearexport_cvs

Converts CVS files to elements

Applicability

Product

Command type

ClearCase®

command

Platform

UNIX

Linux

Windows

Synopsis

clearexport_cvs [ –r [ –A ] ]
[ [ –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_cvs command processes Concurrent Versions Systems (CVS) files so they can be imported into ClearCase elements and versions. The source data can range from a single file to an entire directory tree.

During the export stage, you invoke clearexport_cvs in the area where the CVS files reside. clearexport_cvs creates a datafile (by default, named cvt_data) and places in it descriptions of elements, branches, and versions. clearexport_cvs 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_cvs ignores most information in CVS files that is not related to version-tree structure. clearexport_cvs converts each CVS 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_cvs. You can use the –S and –V options to preserve CVS state attributes and CVS revision numbers as attributes of the corresponding ClearCase version. The –A option enables you to export CVS Attic subdirectories if you choose to recursively descend source_name arguments that specify directories.

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

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

CVS files, working files, and locks

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

clearexport_cvs ignores all CVS locks.

CVSROOT environment variable

You must set the environment variable CVSROOT for the cvs command to work. If, for example, CVSROOT is set to /usr/src/cvs and an element archive is found in the CVS repository as /usr/src/cvs/gui/windows/main.cxxx,v, then an extraction command for a version of the element would look like this:

cvs get –Q –p –r1.1 gui/windows/main.cxx

Drive sharing on Windows

You must share the drive that the CVS repository is on. This is because clearexport_cvs attempts to resolve the UNC path name regardless of what is shared. If the drive is not shared, you will have a path in the cvt_data file that looks like this: \\machine_name\c$\your_folder. The c$ directory is not accessible by clearimport, which fails with a message that indicates that the extract command could not be invoked.

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_cvs, 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 and Linux) or enclose the name in double quotes (Windows). For example, on UNIX and Linux systems:

% clearexport_cvs src\files

On Windows systems:

> clearexport_cvs "src files"

Handling of CVS symbols

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

  • Translation to version labels. Suppose a CVS symbol, RLS_1.3, names a revision, 3.5. clearexport_cvs places a description of label type RLS_1.3 in the datafile, and clearimport imports that label type and assigns a label of that type to the version created from the CVS revision.
  • Handling of magic branches. When clearexport_cvs encounters a magic branch with a symbolic name in a CVS archive, it determines whether any versions have been checked in on that branch. If there are any, the magic branch's symbolic name is used as the name of the ClearCase branch; otherwise, the branch is ignored.
  • Translation to branch names. Suppose a CVS symbol, rls_1.3_fixes, names a branch 3.5.1. clearexport_cvs outputs a description of branch type rls_1.3_fixes, and clearimport creates a branch of that type at the ClearCase version created from CVS revision 3.5.

Because there is no concept of a subbranch of the main branch, clearexport_cvs does not process single-digit symbols that name CVS branches. If a CVS symbol includes characters that are not valid in names of label types or branch types, clearexport_cvs replaces the offending name. For example, the CVS 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 CVS symbol names both a revision and a branch (not necessarily in the same CVS file) clearexport_cvs 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 CVS file. In this case, it creates label type FX354_1.

Translation file

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

  • To look up each CVS symbol to see how to translate it to a label type or branch type. If a match is found, the symbol is translated the same way.
  • To record each translation of a new CVS symbol for use in future lookups.

The first time you use clearexport_cvs, use –T to create a new translation file. On subsequent invocations of clearexport_cvs, 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_cvs 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.

Guidelines for handling exported data

After you export data, do not move the data to another location before importing it.

It is not a good practice to move exported data between different operating systems or between operating systems with different architectures.

Guidelines for handling files imported from CVS Attic directories

When you use the –A option, clearexport_cvs exports files found in CVS Attic directories. In most cases, these are zero-length files that have been removed from or never added to a particular CVS revision. When these files are imported into ClearCase, an empty version is created. While it can be useful to import these files into ClearCase, you should consider importing them onto a specific branch or stream where they can be referred to as needed but will not be selected by typical configurations.

Restrictions

None.

Options and arguments

Handling of directory arguments

Default
If you specify a directory as a source-name argument: (1) clearexport_cvs 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_cvs descends recursively into all source-name arguments that are directories.

Selective conversion of files

Default
clearexport_cvs processes all CVS revisions it finds.
–s date-time
clearexport_cvs processes only CVS revisions that have been modified since the time specified. Use this option for regular, incremental updating of an element from a CVS 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_cvs determines whether to process a CVS 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_cvs does not process any of the revisions in the archive. If the archive's date/time is after the date-time you specify, clearexport_cvs 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 a CVS 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 CVS information as attributes

Default
clearexport_cvs does not attach attributes to versions exported from CVS revisions.
–V
Attaches an attribute of type CVS_REVISION to each newly created version. The string value of the attribute is the CVS revision number of the exported revision. (clearimport creates attribute type CVS_REVISION, if necessary.)

If you use the –s option with this option, clearimport attaches CVS_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 a CVS revision's state is not the default (Exp), attaches an attribute of type CVS_STATE to the newly created version. The string value of the attribute is the CVS state attribute of the exported revision.
–A
Specifies that files found in CVS Attic subdirectories are to be exported as if they were part of the main repository directory. For example, the CVS file, ./proj/Attic/main.c,v is exported as the element ./proj/main.c. For important information about importing these files into ClearCase, see Guidelines for handling files imported from CVS Attic directories.

Directory for temporary files

Default
On UNIX and Linux 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).

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 CVS symbols, clearexport_cvs 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 CVS symbols to version labels and branch names.

Storage location of datafile

Default
clearexport_cvs 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_cvs processes the current working directory (equivalent to specifying a dot ( . ) as the source-name argument). If you specify a directory as a source-name argument: (1) clearexport_cvs 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 CVS or cvs).
source-name ...
One or more path names, specifying CVS files and/or directories:
  • For each specified CVS file, clearexport_cvs places a description in the datafile.
  • For each specified directory, clearexport_cvs places descriptions in the datafile for each of the CVS files it contains. clearimport creates a directory element for the specified directory itself, and for its subdirectories (except one named CVS).

Each source-name can be a simple file or directory name or a wildcard as described in wildcards_ccase. Specifying a parent directory (..) causes an error, as does any UNIX or Linux path name that includes a slash or any Windows path name that includes a slash or backslash. Run this command in a directory under which the elements to be exported reside. If the CVS files reside in CVS subdirectories, use the –r option to enable clearexport_cvs to find them.

Examples

  • Create a datafile for a single CVS file.

    clearexport_cvs myprogram.c,v

  • Process three CVS files in the current working directory and store the datafile in file cvt_include.

    clearexport_cvs -o cvt_include bgr1.h,v bgr2.h,v bgr3.h,v