clearcase snippets

ClearCase commands for listing changes (between builds, by me, etc)

Tagged cleartool, changes, diff, clearcase  Languages bash
# List changes done by me
cleartool lshistory -since 10-January-2007 -recurse -me

# List view only files
cleartool ls -view_only -recurse

# Find changes between two releases
cleartool find PATH -print -version "lbtype(NEW_BUILD_LABEL) && !version(OLD_BUILD_LABEL)"

Recursively add files to ClearCase

Tagged ruby, add, recursive, clearcase, script  Languages ruby

This script adds all files in the current directory to ClearCase.

Save the following script as add_recursively.rb in the directory you want to add to ClearCase:

%x{cleartool ls -view_only -r -s . > view_private_files.txt}

lines ='view_private_files.txt').readlines.collect{|line| %Q{"#{line.chomp}"} }

# Work around command line length limit in Windows
while lines.size > 0
  %x{cleardlg /addtosrc #{lines.slice!(0..100).join(' ')}}

Next open a command line window and execute the script:

cd clearcase_vob
ruby add_recursively.rb

ClearCase sucks, use Mercurial or git instead...