clearexport_pvcs
Converts PVCS files to elements
Applicability
Product |
Command type |
---|---|
ClearCase® |
command |
Platform |
---|
UNIX |
Linux |
Windows |
Synopsis
- clearexport_pvcs [ –r ]
- [ [ –s date-time ] [ –p date-time ]
| –I { now | date-time }
]
[ –V ] [ –G ] [ –t temp-dir-pname ] [ –T translation-file ]
[ –o datafile-pname] [ source-name ... ]
Description
The clearexport_pvcs command processes PVCS files so they can be imported into elements and versions. The source data for export can range from a single file to an entire directory tree.
During the export stage, you invoke clearexport_pvcs in the directory where the PVCS files reside. clearexport_pvcs creates a datafile (by default, named cvt_data) and places in it descriptions of elements, branches, and versions.
In the import stage, you invoke clearimport on the datafile to import information into the new VOB.
clearexport_pvcs ignores most information in PVCS files that is not related to version-tree structure. clearexport_pvcs converts each PVCS label, 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_pvcs.) You can use the –V option to preserve PVCS revision numbers as attributes of the corresponding ClearCase version.
clearexport_pvcs 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.
PVCS files, workfiles, and locks
clearexport_pvcs works directly with PVCS files. It does not process the workfiles created with the get and get –l commands. Be sure to check in workfiles with the put command before running the exporter.
clearexport_pvcs issues warning messages when it encounters checked-out files, but it still processes them. clearexport_pvcs ignores all PVCS locks.
If PVCS files are stored in VCS (or vcs; case is not important) subdirectories, clearexport_pvcs collapses the subdirectory level. For example, PVCS file ./proj/VCS/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_pvcs, rename any file whose name contains these characters.
% clearexport_pvcs src\ files
On Windows, you must enclose the name in double quotes:
> clearexport_pvcs "src files"
On any platform, you must set the PVCS environment variables PVCS_RIGHT_SEPARATOR, PVCS_LEFT_SEPARATOR, or both when processing files whose names contain right or left parenthesis characters. For more information, see the PVCS documentation.Handling of PVCS symbols
A PVCS symbol is a mnemonic name for a particular revision or branch of a PVCS file. clearexport_pvcs 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 PVCS symbol, RLS_1.3, names a revision, 3.5. clearexport_pvcs 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 appropriate version.
- Translation to branch names. Suppose a PVCS symbol, rls_1.3_fixes, names a branch, 3.5.1. clearexport_pvcs outputs information about branch type rls_1.3_fixes, and clearimport creates a branch of that type at the appropriate version.
Because there is no concept of a subbranch of the main branch, clearexport_pvcs does not process single-digit symbols that name PVCS branches. If a PVCS symbol includes characters that are not valid in names of label types or branch types, clearexport_pvcs replaces the offending name. For example, the PVCS symbol C++ may be renamed to C.. .
A label type cannot have the same name as a branch type within the same VOB. If the same PVCS symbol names both a revision and a branch (not necessarily in the same PVCS file), clearexport_pvcs 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 PVCS file. In this case, it creates label type FX354_1.
Translation file
Renaming PVCS symbols can introduce inconsistencies over multiple runs of clearexport_pvcs. The same symbol may be renamed during processing of some PVCS files, but not change during processing of other files. You can enforce consistency by using the same translation file in multiple invocations of clearexport_pvcs. If you name such a file, using the –T option, clearexport_pvcs uses it as follows:
- To look up each PVCS symbol to determine 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 PVCS symbol, for use in future lookups.
The first time you use clearexport_pvcs, use –T to create a new translation file. For consistent name translation, use –T on subsequent invocations of clearexport_pvcs and specify the same translation file.
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_pvcs 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, it prints a summary of the files and directories that could not be exported.
Guidelines for handling data
After you export data, do not move the data to another location before importing it.
It is not a good practice to move data between different operating systems or between operating systems with different architectures.
Restrictions
None.
Options and arguments
Handling of directory arguments
- Default
- If you specify a directory as a source-name argument: (1) clearexport_pvcs 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_pvcs descends recursively into all source-name arguments that are directories.
Selective conversion of files
- Default
- clearexport_pvcs processes all files it encounters.
- –s date-time
- clearexport_pvcs processes only versions modified since the time specified.
Use this option for regular, incremental updating of an element from a PVCS 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 better to use –I instead of
–s.
clearexport_pvcs determines whether to process a PVCS 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_pvcs does not process any of the revisions in the archive. If the date/time is after the date-time you specify, clearexport_pvcs processes the following revisions:
- All revisions created since the specified date-time
- All revisions that have labels
Note: For an incremental update, if you remove a label or branch from a PVCS version, clearimport does not remove the label or branch from the ClearCase element. - –p date-time
- Like -s, but processes only versions modified with new metadata (labels, branches, attributes, and so on) or created before the specified time.
- –I { now | date-time }
- Processes important versions only, but includes all versions created
since the specified time. A version is important if any of these conditions
is true:
- It is the most recent version on its branch
- It has a label
- A subbranch sprouts 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 PVCS information as attributes
- Default
- clearexport_pvcs does not attach attributes to versions exported from PVCS revisions.
- –V
- Attaches an attribute of type PVCS_REVISION to each newly created
version. The string value of the attribute is the PVCS revision number of
the exported revision. (clearimport creates attribute type PVCS_REVISION,
if necessary.)
If you use the –s option with this option, clearimport attaches PVCS_REVISION attributes only to revisions created after the date-time you specified.
Each attribute requires about 1 KB of storage in the VOB database.
- –G
- If a PVCS revision has a promotion group, attaches an attribute of type PVCS_GROUP to
the newly created version. The string value of the attribute is the promotion
group of the exported revision. (clearimport creates attribute
type PVCS_GROUP, if necessary.)
If you use the –s option with this option, clearimport attaches PVCS_GROUP attributes only to revisions created after the date-time you specified.
Each attribute requires about 1 KB of storage in the VOB database.
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.
Translation of branches and labels
- Default
- As described in the section Handling of PVCS symbols, clearexport_pvcs 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 PVCS symbols to version labels and branch names.
Storage location of datafile
- Default
- clearexport_pvcs 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_pvcs processes the current working directory (equivalent to specifying "." as the source-name argument). clearimport creates an element in the new VOB for each element in the current working directory. clearimport creates a directory element in the new VOB for each subdirectory of the current working directory (except one named PVCS or pvcs).
- source-name ...
- One or more path names, specifying PVCS files and/or directories:
- For each specified PVCS file, clearexport_pvcs places a description in the datafile.
- For each specified directory version, clearexport_pvcs places descriptions in the datafile for all the elements it catalogs. clearimport creates a directory element for the specified directory itself, and for its subdirectories.
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.
Examples
- Create entries in the datafile
for the entire tree under directory element src, exporting
important versions created before 1999 and all versions created since the
beginning of 1999.
clearexport_pvcs -r -I 1-Jan-1999 src
- Create entries in the datafile
for the elements in the current working directory, but not in any subdirectories;
store the datafile in a file named newcvt.
clearexport_pvcs -o newcvt .
See also
clearexport_*, clearimport, events_ccase, relocate, rcs(1), rsh(1) or remsh(1), sccs(1), wildcards_ccase