top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Clearcase Administrative Commands.

+8 votes
397 views
  • VOB (versioned object database) is a data repository that holds the files, directories, and any objects that collectively represent a product or a development effort.

cleartool mkvob -tag vob-tag -comment comment -tcomment tag-comment -stgloc vob-stgloc-name

  • How to change ownership and protection on clear case object.

cleartool protect -chown owner_id -chgrp group_id element_name

  • How to delete others view OR how to uncheckout others file

cleartool lsview -l theViewToRemove # get its uuid
cleartool rmtag -view theViewToRemove
cleartool unregister -view -uuid uuid_of_viewToRemov

  • How to create snapshot view:

ct mkview -snapshot -tag view_name -stgloc -auto view_name


Find commands:

  1. Find element created by date.
    ct find . -version "{brtype(branch_name) && created_since(5-March)}" -print

  2. List all file elements in and below the current working directory.
    cmd-context find . –type f –print
    ./Makefile@@

  3. List all objects owned by user smg throughout all mounted VOBs.
    cmd-context find –amjain_anam viewvobs –user smg –print
    \work_vob\hw\util.c@@

  4. List the version labeled REL1 for each element in or below the current working directory.
    cmd-context find . –version "lbtype(REL1)" –print
    .@@/main/1

  5. Excluding any elements that do not have both labels, list all versions in the current VOB labeled either REL1 or REL2 but not both.
    cmd-context find –all –element '{lbtype_sub(REL1) && lbtype_sub(REL2)}' ^
    –version '{(lbtype(REL1) && ! lbtype(REL2)) || ^
    (lbtype(REL2) && !lbtype(REL1))}' –print
    \dev\testfile.txt@@\main\43

  6. List each header file (*.h) for which some version is labeled REL2 or REL3.
    cmd-context find . –name '*.h' –element 'lbtype_sub(REL2) \ || lbtype_sub(REL3)' –print
    ./hello.h@@

  7. List all versions that have a QAed attribute with the string value "Yes".
    cmd-context find . –version 'QAed == "YES"' –print
    .\Makefile@@\main\2
    .\hello.c@@\main\4

  8. List the standard name of each element that has (or contains a branch or version that has) a BugNum attribute with the value 189.
    cmd-context find . –nxname –element 'attr_sub(BugNum,==,189)' –print
    ./hello.c

  9. For each element that has had a merge from the rel2_bugfix branch to the main branch, archive the current version of the element to a tar(1) file in your home directory.
    find . –element "merge(/main/rel2_bugfix, /main)" \ –exec 'echo $CLEARCASE_PN >> /tmp/filelist'

  10. If any element's most recent version on the main branch is missing label REL3, label it.
    cmd-context find . –version 'version(\main\LATEST) && ! lbtype(REL3)' –exec 'cleartool mklabel –replace REL3 %CLEARCASE_XPN%'

  11. Attach a Testing attribute with string value "Done" to all versions labeled REL2. Note that the double-quote characters that enclose the string value must themselves be escaped or quoted:
    cmd-context find . –ver 'lbtype(REL2)'\ –exec 'cleartool mkattr Testing \"Done\" $CLEARCASE_XPN'

  12. Conditionally delete all branches of type experiment.
    cmd-context find . –branch brtype(experiment) –ok 'cleartool rmbranch –force %CLEARCASE_XPN%'

  13. (ClearCase only) Change all elements currently using storage pool my_cpool to use pool cdft instead.
    cmd-context find . –all –element 'pool(my_cpool)' \ –exec 'cleartool chpool cdft $CLEARCASE_PN'

  14. Obsolete elements that are no longer visible.
    cmd-context find . –all –nvisible –exec 'cleartool lock –obsolete %CLEARCASE_PN%'

  15. List merges (recorded by hyperlinks of type Merge) involving versions located at the ends of branches named gopher.
    cmd-context find . –version 'version(.../gopher/LATEST)' –print \ –exec 'cleartool describe –short –ahlink` Merge $CLEARCASE_XPN'strong text

  16. In the current directory and its subdirectories, list element versions that are on the branch main_dev and that were created in May of this year and that are not the LATEST versions.
    cmd-context find . –version "{brtype(main_dev) && created_since(30-Apr) && (! created_since(31-May)) && (! version(\main\main_dev\LATEST))}" -print

  17. /usr/atria/bin/cleartool find . -type f -version "{created_since(2013-11-09) && (! created_since(2013-11-13)) && brtype(branch_name)}" -print

posted Jan 26, 2014 by Amit Kumar Pandey

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button


Related Articles

Clearcase is one of the best version control System developed by IBM but having a costly license. Many big companies using Clearcase to store their assets and doing development in clearcase environment .
Here I am giving daily used command :

1. How to create dynamic view
$ cleartool mkview -tag view_tag -stgloc -auto (where -stgloc is default view storage and view_tag is view name)

2. How to set view
$ cleartool setview view_name

3. How to see your view name (present working view)
$cleartool pwv

4. How to create element type
$cleartool mkeltype element_name (Element is file or directory)
After creating element type create element using below command
$cleartool mkelem element_name

5. How to take checkout for modification
$cleartool co element_name

6. After modification you can check In that element
$cleartool ci element_name

7. How to check Checkout elements by your view recursively in current directory:
$cleartool lsco -r -s -cview

8. How to create branch type in your vob:
$cleartool mkbrtype branch_name (You can create Label type, Attribute type and other type as well just use mklbtype, mkartype so on)

9. How to see lsvtree of element (Only editor which support GUI)
$cleartool lsvtree -g element_name

10. How to check merge requirement with your view from any label in your directory recursively
$cleartool findmerge directory-path -fver label-name -print (This will print all elements which needs to be merged from that label ant place of label you can give branch name as well)

11. How merge these elements print by above command:
$cleartool findmerge directory-path -fver label-name -merge

12. How to merge directory
$cleartool merge -to . -qall -version branch-name/LATEST

13. Recursively apply a label a directory and all its content:
$cleartool mklabel -r -rep label-name directory-name

14. How to know everything about any type(branch, label, hyperlink, attribute)
$cleartool desc -long -type test_br /This is branch type/

15. How to rename any type (branch label etc)
$cleartool rename brtype:old_branch brtype:new_branch

READ MORE
...