working on it ...

Filters

Explore Public Snippets

Sort by

Found 18 snippets matching: clearcase

    public by lbottaro  901639  60  8  1

    How to remove all checked out files in clearcase

    This cleartool command lists all the checkout files (both from the current directory and from the entire view) searching in each directory or vob path. For each element found, it invokes the command to remove the checkout.
    # Remove ALL checked out files from view in the entire vobs
    cleartool lsco -cview -me -avobs -short | xargs cleartool unco -rm 
    
    # Remove ALL checked out files from the current directory on only
    cleartool lsco -cview -me -rec -short | xargs cleartool unco -rm 

    public by lbottaro  529684  10  8  0

    How to get the list of all the activities comparing two UCM streams in python

    This script shows how to get the list of all the activities comparing two ucm streams. The command returns a list object you can easily loop and print.
    import os
    
    bl_old="myOldBaseline@/MyVobs"
    bl_new="myNewBaseline@/MyVobs"
    myView = "MyView"
    
    diff_act=os.popen("cleartool setview -exec \"cleartool diffbl -nmerge -activities "+bl_old+" "+ bl_new+" \" " +myView).readlines()
    
    for act in diff_act:
      print ("ACTIVITY: "+str(act))
    

    public by lbottaro  3587  1  7  0

    Bash one-liner to remove clearcase views in parallel

    This bash one liner script allows to remove all the Clearcase views that match some criteria in parallel. In this case views are listed by 'lsview -s' cleartool command, filtering with grep on specific . Note the '-s' option to get view name in short format. Once each view is returned, xargs command executes the cleartool 'rmview' command,
    cleartool lsview -s | grep <WORD> | xargs -I '{}' sh -c 'cleartool rmview -tag {} &'     

    public by lbottaro  5504  12  8  0

    How to force remove an element in Clearcase

    This cleartool command will forcibly remove a version of an element, removing any reference, link, attribute, label or branch present for that version. The command can be executed when facing the "Removal of interesting versions" error when trying to delete a clearcase object. Options: –xbranch - Deletes a version even if one or more branch
    cleartool rmver -xhlink –xbranch –xlabel –xattr test.txt@@\main\3

    public by lbottaro  14521  56  8  0

    How to list files changed in clearcase ucm stream activities

    This script lists the files changed in all the activities delivered on a specific stream, with no duplicates. The stream is the one currently set on the clearcase view.
    #!/usr/bin/tcsh -f
    # This script lists the activities of a stream and saves on the following file the changed files without duplicates.
    
    set tmpoutput = "$HOME/.tmp_AllChangedFilesInStream.txt"
    set output = "$HOME/AllChangedFilesInStream.txt"
    rm -rf $tmpoutput
    touch $tmpoutput
    rm -rf $output
    touch $output
    
    foreach act ( `cleartool lsact -s | grep -v rebase` )	
        set changeset = `cleartool lsact -fmt "%[versions]p" $act`
        echo $changeset | tr ' ' '\n' >> $tmpoutput
    end
    
    foreach line ( "`cat $tmpoutput`" )	
        set file=`echo $line | sed -e "s|\(.*\)@@.*|\1|"`
        
        set isPresent = `grep "$file" "$output"`
        if ("$isPresent" == "") then
          echo $file >> $output
        endif  
    end
    
    rm -rf $tmpoutput
    
    exit 0

    public by lbottaro  7243  4  7  0

    Make UCM clearcase activity using cleartool command

    Here are some examples on how to make, create and set activity in IBM Clearcase UCM environment, using cleartool mkact command. Source: http://www.ipnom.com/ClearCase-Commands/mkactivity.html
    # Create an activity, but do not set it to be the current activity for the view.
    # User is prompted to proceed 
    cleartool mkact –nset 
    Create activity with automatically generated name?  [yes] yes
    Created activity "activity990917.133218".
    
    # Create and set an activity attached to the current view.
    cleartool mkact new_activity 
    Created activity "new_activity".
    Set activity "new_activity" in view "java_int".
    
    # Create and set an activity whose name is generated automatically. 
    # User is not prompted for confirmation.
    cleartool mkact -f 
    Created activity "activity990917.134751".
    Set activity "activity990917.134751" in view "java_int".
    
    # Create and set an activity with the headline “Create directories”.
    cleartool mkactivity -headline "Create directories" create_directories 
    Created activity "create_directories". 
    Set activity "create_directories" in view "webo_integ".

    public by lbottaro  3649  1  7  1

    How to get the baselines from UCM stream in python

    This simple python script will detect the baselines configured on a given UCM Clearcase stream. At the end it will print the latest baseline found.
    import os
    stream = "myStream@/myVobs"
    latest_bl=os.popen("for a in `cleartool lsstream -fmt \"%[latest_bls]p\" " + 
                       stream + "`; do echo $a; done").readlines()
       print "Latest baseline found = " + str(latest_bl)

    public by MarcoDeMagistris  4417  2  6  0

    Clearcase: Move mastership

    Move mastership from server1(replica_name1) to Server2(replica_name2)
    Creates a default dynamic view (i.e. default config_spec) and set it (cleartool setview <view_name>)
    
    Vobs check
     - Moving in vobs path: cd /vobs/<vobs_name>
     - Find checkout file, locked elements and triggers on server1.
    		CT=cleartool
    		VOB=`pwd`
    		echo "CHECK CHECKOUT" > log.log
    		cleartool lsco -all -l >> log.log
    		echo "CHECK TRIGGER" >> log.log
    		cleartool lstype -kind trtype >> log.log
    		echo "CHECK FILE LOCKED" >> log.log
    		cleartool lslock -fmt "%Km:%n@$VOB\n" -all vob:$VOB >> log.log
    
    - Remove them using:
    	-	Undo checkout:
    		Find all views with checkout files:
    			cleartool describe -l vob:<vob tag>
    		Removes view checkout from vobs:
    			cleartool rmview -vob . -uuid <view uuid>
    	- Unlock commands: cleartoolt unlock <label, branch, type>
    		#ct unlock brtype:<branch name>
    		#ct unlock brtype:<label name>
    	- Remove triggers running:
    		#cleartool rmtype -rmall trtype:<.triggers_name>
    
    - Check replica running "cleartool lsreplica" commands
    
    - Change Mastership running:
    	 cleartool chmaster -all -long replica_name2 > ~/log
    
    - Check change mastership:
     	cleartool lsmaster -kind attype,branch,brtype,delem,eltype,felem,hlink,hltype,lbtype,slink,vob <replica>
        
    Insert in new Clearcase server (server2), the locked files and the triggers removed previously.

    public by MarcoDeMagistris  3556  5  6  0

    Clearcase: How to remove the Clearcase view from Clearcase Register

    How to remove the Clearcase view from Clearcase Register
    Step1) Determine a UUID of the View:
    
       cleartool lsview -long test (if needed you can add -region option)
         Tag: test
             Global path: \\host1\ccstg_e\views\test.vws
     			Server host: host1
     			Region: dev
    			 Active: NO
    	 View tag uuid:c8b329ed.60814357.9806.26:55:85:75:e2:bf
    	 View on host: host1
    	 View server access path: e:\ClearCase_Storage\views\test.vws
    	 View uuid: c8b329ed.60814357.9806.26:55:85:75:e2:bf
        View owner: DOM1\pippo
    
    STEP 2) Remove the registry entry using the -uuid option with unregister:
    		> #cleartool unregister -view -uuid <uid>
    		>cleartool unregister -view -uuid c8b329ed.60814357.9806.26:55:85:75:e2:bf
    
    STEP 3) Remove the tag entry using the cleartool rmtag command:
    			cleartool rmtag -view
    
    STEP 4) Remove the view:
    			cleartool rmview -force -all -uuid <uid>

    public by lbottaro  7856  32  8  0

    How to checkin all checked out files in linux clearcase

    This simple csh script loops for any checked out file in the current directory tree and check it in. Command option: -cvi: list file for current view only -rec: search for files recursively from current directory -s: return file in short name format -c: add comment to checkin
    #!/bin/csh
    foreach name (`cleartool lsco -rec -cvi -s .`)
       echo $name
       cleartool ci -c "Comment for file" $name
    end
    • Public Snippets
    • Channels Snippets