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 checked out
unreserved, only one person can check it back in and create a successor version.
However, any unreserved checkout can be checked in via a merge.
If checking out a derived object, CC will attempt to perform a winkin to
your view. If the winkin fails, for various reasons, it will just copy
it in as a local view-private file. Permissions on the checkedout file
are determined by the following:
1) Start with the permissions on the element itself.
2) Add write permission wherever the element has read permission.
3) Subtract read, write and/or execute based on your personal umask.
Permissions on a checkedout file can be changed at will. However, only use the
ct protect command to change permissions on a checked in element or derived object.
See also cleardlg on NT.
Back to the Table of Contents.
Checkin 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. On the command-line, checkout can be abbreviated to ci.
From CC Web, select the check-box next to the element(s) and click
on Checkin at the top of the page. Only one comment can be applied to all
checkins during on Checkin command.
From the CLI:
# ct ci element
Common options:
| -nc
| No checkin comment. If checkout comment exists, it uses that.
|
| -ide.ntical
| Checkin even identical to predecessor. (not available in xclearcase)
|
| -kee.p
| Keep a view-private file called element.keep as well as the checkedin version.
|
|
| This is automatically prompted for each NT checkin. Not applicable to directories.
|
| -fro.m
| Use the specified file as the checkin version instead of the view-private file.
|
|
| The option -keep is invoked.
|
| -ptime
| Preserve the modification date/time. This is important if the file date outside CC denotes version.
|
If the predecessor of the version checked out is not the LATEST
version on the branch, CC will not let you check it back in. This
can happen if the checkout was unreserved or the
-version option was used. If this happens and you don't want to do
an uncheckout, you will need to merge with the LATEST. For that,
make the LATEST version the "from" version and merge it to your
checked out version. Then a checkin should be possible.
If the element is "[checkedout but removed]", it means the checkedout
version is missing for some reason. Use an uncheckout if the checkedout
version cannot be located.
See also cleardlg on NT.
Back to the Table of Contents.
Uncheckout an element.
In Windows, right-click on the element.
In xclearcase, left-lick on the element and go to the Versions menu.
From CC Web, select the check-box next the element(s) and click on
Undo Checkout at the top of the page.
From the CLI, uncheckout can be abbreviated as unco. Use the
-keep option to keep a copy of the checkedout version.
File checkouts are cancelled via the uncheckout command. This destroys
the the checkedout view-private version and erases any record of the checkout.
I.E. There is no such thing as an uncheckout event record. An element in
another view can be unchecked out by using a view-extended pathname. However,
if the other view's storage area isn't accessible, that won't work. Unfortunately
there is no way to suppress the prompt for the saving of a private copy without
using the -keep option with a subsequent removal of the .keep file.
# ct unco element
UNIX
# ct unco /view/view-tag/path/element
NT
# ct unco X:\vob-tag\path\element
WARNING! If an element is unchecked out
immediately after creation
and you don't save a private copy when prompted, the file contents will be lost.
CC creates the 0th version as an empty place holder. An unco of version 1 will
result in an empty file. Note that the 0th version on branches will only be empty
if the version from which they branched were also empty.
Back to the Table of Contents.
List/find CHECKEDOUT elements.
In Unix xclearcase, Report -> List checkouts.
In the Windows, right-click on any element and select Find Checkouts.
On both Unix and Windows, the GUI can be invoked from the CLI via clearfindco.
From CC Web, simply click on My Checkouts at the top of the page.
There is no way to find checkouts in another view from the web.
NOTE: There is no way to use the "ct find" command to find checkouts.
From the CLI:
lsco
The lsco command must be run while already in a view context.
That is, there's no way to specify the viewtag of another view, which
makes it difficult to use in utility type scripts.
# ct lsco [pname]
There are many options to control the scope; which elements and/or
directories are searched for checkedout elements. The default is
to search the current directory only for elements checkedout under
any view.
| -all
| List all versions of directories.
|
| -r.ecurse
| Search recursively.
|
| -brt.ype branch-name
| Restrict the listing to checkouts from branch-name.
|
| -cvi.ew view-tag
| Restrict the listing to checkedouts in view-tag.
|
| -me
| Restrict the listing to checkedouts by me.
|
| -use.r login-name
| Restrict the listing to checkedouts by login-name.
|
| -avo.bs
| Search all currently mounted VOBs. (dynamic views only)
|
| -are.plicas
| Search all replicas of the VOB designated by pname.
|
| -fmt format-string
| Format the output. See fmt_ccase in the CC Reference Manual.
|
Each of the above options limit the scope in an inclusion type
way. But, what if you want to find all checkouts NOT by me (exclusion).
The following example will find all reserved checkouts from the main
branch by a user other than "user1". The fmt option lists
"reserved/unreserved,view-tag,user.group,element". The egrep command only
works on Unix. Windows has a findstr command similar to grep, but no
equivalent to egrep.
# ct lsco -recurse -brtype main -fmt "%Rf %Tf %Lu %En\n" | egrep -v '(unreserved | user1 )'
lsprivate
The lsprivate command can also be used
to find checkouts. Use its -co option. The lsprivate command doesn't
work in snapshot views. Also, it won't report on checkedout directories, as
there is no view-private version of a checkedout directory. Also, it doesn't
have the useful -avobs option that lsco does.
ls
Another way to find checkouts is the "ct ls -view_only". But with this
method there is no way to differentiate between checkouts and other types
of view-private files.
NOTE: If you remove a load rule from a snapshot view, the
files are normally completely removed from the view root. However, if
there were any view-private files there, including checkouts, the unloaded
files/directories will be officially unloaded from the view but not removed
from the view-root. They will simply be renamed as "<element>.unloaded".
If you run lsco in a snapshot view, the command will not find checkedout
elements that have been unloaded.
Back to the Table of Contents.
Find all elements with a given characteristic.
In UNIX xclearcase, Report -> Find query.
On NT, the "find" command is only available on the command-line.