From the CLI:
ct diff
The diff subcommand can diff between text or directory elements
in the same view or in different views. The following are a
few of the permutations. See the CC Reference Manual for a full listing.
# ct diff element element@@/main/branch/LATEST
# ct diff -predecessor element
# ct diff -graphical element /view/view-tag/element
Note that diff can only be used in a VOB context.
cleardiff
A cleardiff will give the same output as a simple diff command, but it
has more formatting options. It cannot diff directory elements and does
not have a -graphical option. The two files being diff'ed do not have to
be in CC.
# cleardiff element-version1 element-version2
xcleardiff
The UNIX only, stand-alone command xcleardiff utilizes xcompare and xmerge.
It can be invoked by itself or via a "diff -graphical", "merge -graphical"
or "findmerge -graphical". The font and colors can be customized. See "schemes"
in the CC Reference Manual.
# xcleardiff element-version1 element-version2
Some useful options:
| -b.lank_ignore
| (diff) Do not display differences in blank lines when diff'ing.
|
| -col.umns n
| Divide n by 2. Default n is 80; 40 chars per column.
|
| -tin.y
| (diff or merge) Use smaller fonts.
|
| -vst.ack
| (diff or merge) Display the diff'ed files stacked vertically (default is horizontal).
|
| -out
| (merge) Specify a checkedout version or system file (required).
|
| -f.orce
| (merge) Overwrite the output file, if it already exists.
|
| -bas.e base-pname
| (merge) By default, xcleardiff does not calculate a base contributor.
|
| -q.uery
| (merge) No automatic merging for non-trivial merges.
|
| -qal.l
| (merge) No automatic merging at all. Automatically set if base not specified.
|
| -abo.rt
| (merge) Abort if conflict arises. Used when called from a script.
|
| -pause
| (merge) Do automatic merges, but pause for confirmation after each change.
|
| -win.dow
| New in CC 2003.06.00. Disply the output in a separate difference window.
|
See also cleardlg on NT.
Back to the Table of Contents.
Remove a merge arrow from an element's version tree.
The following subcommand will remove the merge arrow that appears
in an element's version tree. It does not affect either version
of the element that was merged.
# ct rmmerge from-version to-version
Back to the Table of Contents.
Remove a version of an element.
The rmver command destroys information irretrievably.
It cannot remove a previous version of a file that is currently
checked out, nor can it remove an interesting version: labeled,
branch point, merge point, etc...; unless the appropriate option
is used.
Delete uninteresting versions.
# ct rmver element-name
Delete a specific version.
# ct rmver -version /main/bugfix/5 element-name
Other useful options:
| -f.orce
| don't ask for confirmation
|
| -xbr.anch
| remove even if branch point, all version on the branch are removed also
|
| -xla.bel
| remove even if labelled
|
| -xat.tr
| remove even if attribute attached
|
| -xhl.ink
| remove even if hyperlink attached
|
| -dat.a
| only delete the data container leaving the database intact,
explicitly invokes the above listed -x options
|
| -vra.nge
| specify a range of versions
|
NOTE: The rmver subcommand does not actually recover disk space,
but merely marks that version as removed. This is not true for whole copy
types though. History information is removed in both cases.
Back to the Table of Contents.
Create a directory element.
In Windows, right-click on the parent directory and choose Open.
Use File -> New -> Folder to create a view-private directory.
Then right-click on the new directory and "Add to Source Control...".
In xclearcase, click on the Shell button and use the command-line.
On the CLI, simply use the CC equivalent of the UNIX mkdir command.
The directory will be created in a checkedout state unless
the -nco option is used.
# ct mkdir directory-element
or
# ct mkelem -eltype directory directory-element
For each method, the parent directory must be checked-out first.
Unlike UNIX, there is no associated "rmdir" command. Must
use the rmelem to delete a directory element. Any contents of a deleted directory
element will end up in the lost+found directory.
Options:
| -master
| New in CC 2003.06.00. The replica in which element is created will explicitly
master the main branch.
|
NOTE: Creating a directory element from an existing view-private directory
only works in a Windows GUI. I.E. You will get the following error
message from the CLI: Can't create directory element because ... already exists.
If you need to create a directory element from the command-line and it
already exists as a view-private directory or is out in the system somewhere, use
the clearexport_ffile and clearimport commands. See
"Import large amounts of data"
for more information on that process.
Back to the Table of Contents.
List details about the contents of an element version.
Output is written to a view-private file element.ann.
# ct annotate -long -ndata element
Some useful options:
| -nda.ta
| Use when dealing with element types other than text.
|
| -nhe.ader
| Suppress the header and output only annotated text lines.
|
| -out
| Use to send output to a file other than element.ann.
Use a dash "-" as the output filename to send to standard out.
|
| -rm
| Show deleted lines.
|
| -a.ll
| Show changes no matter what branch. That is, changes made to branches
that don't affect the current version.
|
| -fmt format-string
| Format the output. See fmt_ccase in the CC Reference Manual.
|
| -rmf.mt rm-format-string
| New in CC 2003.06.00. Specify a format for deletion annotations. The default format is "DEL %Sd %-8.8u | ".
|
Back to the Table of Contents.
Checkout an element.
In Windows, right-click on the file.
In xclearcase, left-click on the file to highlight it then go to
the Versions menu.
From CC Web, select the check-box next to the element(s) and click
on Checkout at the top of the page. You can only apply one comment to all
elements checkedout with the same Checkout command.
From the CLI checkout can be abbreviated to co. This will
checkout the version of the element selected by the current view.
# ct co element
Checkouts are recorded both in the view and VOB databases.
Some options:
| -ver.sion
| Checkout a specific version not necessarily selected by the current view.
|
| -bra.nch branch
| Checkout the LATEST version on the specified branch.
|
| -out file
| Checkout an element under a different name.
|
| -unr.eserved
| Checkout an element allowing others to check it out also.
|
| -unr.eserved -nma.ster
| Checkout even if the local site doesn't master the branch.
|
WARNING! When merging in the changes
from the checkout from a previous version, the Merge hyperlink will erroneously
point to the version just prior to LATEST.
NOTE: A single view can have only one checked out version of an element at
a time. Files can only be checked out if you have write permission to the view's storage
directory. At most, there can be only one reserved checkout of an element.
WARNING! While only the checkout owner can
check an element back in, if two users are using the same view, they can
modify any element checked out to that view (file permissions permitting).
# ct co -nc -unreserved element
# ct co -version element@@/main/version
# ct co -branch /main/bug_fixes element
# ct co -out element_test element
Files are normally checked out reserved. That is, only the person
who checks it out can check it back in.
The element can also be checked out unreserved, which means that someone else
can check it out too. However, if more than one person has it